64 604
Assignments Done
99,1%
Successfully Done
In September 2018

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.
Expert's answer
# 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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions