Question: Look at the following program: int main( ) {int exponent = 1; int three = 1; while (exponent
Look at the following program:
int main( )
{int exponent = 1;
int three = 1;
while (exponent <= 5)
{ three = three * 3;
cout << two << endl;
++exponent; }
return 0; }
(a) What is displayed?
(b) Change the while loop (and body of the loop) to a for loop.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
