Answer to Question #25215 in C++ for marietoni
Create a function-oriented program that is responsible for inputting the data, for the formula, and for displaying the result.
1
2013-02-28T09:38:10-0500
# include <iostream>
# include <string>
# include <cstring>
using namespace std;
double mypow(double &val,int &step){
double r=1;
for (int i=0;i<step;i++){
r*=val;
}
return r;
}
int main(){
cout<<"Enter number:";
int st;
double n;
cin>>n;
cout<<"Enter pow:";
cin>>st;
cout<<"number "<<n<<" in pow "<<st<<" = ";
cout<<mypow(n,st);
system("PAUSE");
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment