Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double power(double a,int n)
- {
- double a1=1;
- for (int i=0;i<n;i++)
- {
- a1=a*a1;
- }
- return a1;
- }
- int main()
- {
- double a;
- int n;
- cin>>a>>n;
- cout<<power(a,n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement