0

int num = 1; int number; while (num <= 5) { cin >> number; num++; }

can any one tell me this code in simpler way. I didn't understand anything.

22nd Jun 2018, 9:28 AM
Superman Batman
Superman Batman - avatar
2 Answers
22nd Jun 2018, 12:30 PM
Andre Daniel
Andre Daniel - avatar
+ 1
int number; for(num=1;num<=5;++num) { cin>>number; } The code 4 times asks you to input an integer and saves it to number variable. Because it is saved into the same variable, after the cycle finishes, the last value you had entered is saved.
22nd Jun 2018, 12:06 PM
Š”Š¼ŠøтрŠ¾ Š†Š²Š°Š½Š¾Š²
Š”Š¼ŠøтрŠ¾ Š†Š²Š°Š½Š¾Š² - avatar