Hey guys
i got a problem with writing this program
its supposed to ask the user to input 2 integers
process : the program should assign the second integer as a power for the first integer (as long as the base is >0 and the power is >=0).
this is the code i came up with
CODE
#include <iostream>
using namespace std;
int main () {
int x;
int y;
int m;
cout<<" Enter the first number Base"<<endl;
cin>>x;
cout<<" Enter the second number Power"<<endl;
cin>>y;
while ( y>=0 && x>0) {
m=
cout<<" The result is "<<endl;
cout<<m;
}
cout<<" Math error! "<<endl;
return 0;
}
Math error should shows up when x=0 coz 0^0 is undefined
Anyway
I've tried to define m as the sum or the multiplicaton product of the two integers and it worked .
I just have a problem with the symbol of "Power"
i wanna type m= (x*x) y times
but i dunno what is the right way to do it
any idea ?