The code only executes the nested while once.. why??
int base, expo, power;
while (base!=0 && expo!=0)
count = 0;
cout<<"Enter Base: ";
cout<<"Enter Exponent: ";
//if i put base = 5 and expo = 3 , the power displayed is still 25
base*base is the same value no matter how many times you do the calculation.
loop is also defective.
base and expo are uninitialized.
You're depending on the unitialized values of base and expo to be non-zero for the body of the while statement to execute.
Please don't cross post.
Last edited on
got my code to work..
sorry for the Cross Post,