+ 1

There is a piece of code do not understand, I hope you teach me,thankyou!!!

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

10th Aug 2017, 1:22 AM
Faith Z
Faith Z - avatar
2 odpowiedzi
+ 3
hi, this program will read 5 input from user and add to total and finally print the sum of 5 numbers.
10th Aug 2017, 2:02 AM
Nanda Balakrishnan
0
Can you teach me?
10th Aug 2017, 1:30 AM
Faith Z
Faith Z - avatar