+ 1

Hi. What is wrong with this code

I am trying to sum the inputs from the users 5 times , here is the code #include <iostream> using namespace std; int main() { int num = 1; int total = 0; int number; while (num <= 5){ cin >> number; number += num; num++; cout << number } return 0; }

6th May 2018, 5:45 PM
Dyary
Dyary - avatar
2 Answers
0
You forgot to puts semicolon (;) on "cout << number", It's must be "cout << number;".
18th Jul 2018, 10:47 AM
Ooflamp
Ooflamp - avatar