whenever I run this code on the Code Playground, it says seems like your program needs an input, pls help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

whenever I run this code on the Code Playground, it says seems like your program needs an input, pls help

#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; return 0; }

19th Jun 2020, 8:00 AM
ADEEVA
2 Answers
+ 3
yes because you are asking for input by cin >>number
19th Jun 2020, 8:03 AM
Abhay
Abhay - avatar
+ 3
Open and run this code to understand how input works in SoloLearn 👍 https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
19th Jun 2020, 8:05 AM
Ipang