0
W.A.P. in c++ to power (). User have to insert no.and raised to the power using call by value.
3 odpowiedzi
+ 1
#include<iostream>
#include<maths.h>
using namespace std;
int main()
{
int a,b; // declaring two variables
cout<<"Enter base and power : "; /* input base and power from user */
cin>>a>>b;
int s; // variable to store result
s=power(a,b);
cout<<endl;
cout<<" power "<<b<<"of the base "<<a<<"is : "<<s;
return 0;
}
int power(int b,int n)
{
return(pow(n,b));
}
0
thanks..# Dharm
0
ok