- 1

plz... any one explain this this is my humble requiest

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

17th Aug 2017, 12:49 AM
ROSHAN SHETTY
ROSHAN SHETTY - avatar
3 ответов
+ 5
What is your request?
17th Aug 2017, 12:50 AM
Manual
Manual - avatar
+ 13
int num = 1; int number; int total = 0; while (num <= 5) { cin >> number; total += number; num++; } cout << total << endl; // num is initially 1, and loop runs while num <= 5, so the loop body will run for num values 1, 2, 3, 4 and 5, that is, 5 times. // in loop body, user input to number, and the number is added to total for each loop. // after the loop is completed, the program outputs total, which is the sum of five user input
17th Aug 2017, 1:06 AM
Hatsy Rei
Hatsy Rei - avatar
Актуальное сегодня
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
AI
2 Votes
help
0 Votes
APIs
1 Votes