+ 1

Using a while Loop

int num = 1; int number; int total ; while (num <= 2) { cin >> number; total += number; num++; } cout << total << endl; If the int total is not declare as 0, what will happen?

8th Apr 2018, 8:56 PM
xin zhang
xin zhang - avatar
1 Odpowiedź