Answer to Question #25215 in C++ for marietoni

Question #25215
Create a function-oriented program that is responsible for inputting the data, for the formula, and for displaying the result.
1
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS