+ 7

Why this is not working for me? Help

Why this not work for me #include <iostream> using namespace std; int main() { int num = 1; int number; int total = 0; while (num <= 5) { cin >> number; total += number; num++;} cout << total << endl; }

9th Apr 2021, 2:51 PM
RIP VIP
RIP VIP - avatar
26 Réponses
+ 6
Ok, see this code, run it and it will explain how we give input in Code Playground https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
9th Apr 2021, 3:11 PM
Ipang
+ 4
The code works but the question is how respectively what did you like to do?
9th Apr 2021, 2:57 PM
JaScript
JaScript - avatar
+ 4
On SL Playground you have to set the ALL inputs data at start of this code. For example: 1 1 1 1 1
9th Apr 2021, 3:04 PM
JaScript
JaScript - avatar
+ 4
Thanks
9th Apr 2021, 3:17 PM
RIP VIP
RIP VIP - avatar
+ 4
Wow you have 1110 Day streak
9th Apr 2021, 3:19 PM
RIP VIP
RIP VIP - avatar
+ 3
Its just a lesson but it is not working
9th Apr 2021, 2:58 PM
RIP VIP
RIP VIP - avatar
+ 3
No output
9th Apr 2021, 3:05 PM
RIP VIP
RIP VIP - avatar
+ 3
U need 1 more for 1111
9th Apr 2021, 3:22 PM
RIP VIP
RIP VIP - avatar
+ 3
Can you Follow me so i lill get my 1st follower
9th Apr 2021, 3:23 PM
RIP VIP
RIP VIP - avatar
+ 3
This code is working perfectly. What's your issue?
10th Apr 2021, 9:55 AM
Mohak Muskan
Mohak Muskan - avatar
+ 3
Idk
10th Apr 2021, 10:03 AM
RIP VIP
RIP VIP - avatar
+ 2
Its after "num++"
9th Apr 2021, 3:02 PM
RIP VIP
RIP VIP - avatar
+ 2
Yeah missed that one sorry. What you got? error message? no output?
9th Apr 2021, 3:05 PM
Ipang
+ 2
Try to give input like JaScript example and try once more
9th Apr 2021, 3:07 PM
Ipang
+ 2
Ok
9th Apr 2021, 3:08 PM
RIP VIP
RIP VIP - avatar
+ 2
It says i cant put it there
9th Apr 2021, 3:09 PM
RIP VIP
RIP VIP - avatar
+ 2
No problem 👌
9th Apr 2021, 3:18 PM
Ipang
+ 2
LOL I didn't even count Never mind, it's nothing just got the time to login daily
9th Apr 2021, 3:21 PM
Ipang
+ 2
Don't worry about followers More important is to learn We're in SoloLearn not Fb anyways 👌
9th Apr 2021, 3:29 PM
Ipang
+ 2
But i want one
9th Apr 2021, 3:33 PM
RIP VIP
RIP VIP - avatar