Nested While HELP!

The code only executes the nested while once.. why??

int main()
int base, expo, power;
while (base!=0 && expo!=0)
count = 0;
cout<<"Enter Base: ";
cout<<"Enter Exponent: ";
cout<<"Power: "<<power<<endl;

//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.
Your outer while 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
Tnx Guys,
got my code to work..

sorry for the Cross Post,
newbie here.
Topic archived. No new replies allowed.