0
while loop cpp
Why does this code not work? What means the output? Thanks for every answer! #include <iostream> using namespace std; int main() { int x; int i = 1; while (i < 5) { cin >> x; cout << x+x; i++; } } Output after entering a number (for example 1) : bash: 1: command not found
3 Réponses
+ 2
It works fine. Just like JaS said in sololearn you have to give all inputs at start. For example: when SL asks for input enter something like
1
2
3
4
And it should work fine.
+ 2
This code works fine. Only in SL Playground you have to put all data input at its start.
+ 1
It works for me.