Answer to Question #174775 in C++ for Tanjunxi

Question #174775

  What is the output of the following C++ code?

int i = 0;

int temp = 1;

while (i < 5)

{

i = i + 1;

temp = temp * i;

}

cout << "i = " << i << " and temp = " << temp << endl;

1
Expert's answer
2021-03-23T09:24:26-0400

i = 5 and temp = 120


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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS