0
Why every next number executes in a new line?
#include <iostream> using namespace std; int main() { int num = 1; int number; while (num <= 5) { cin >> number; num++; } return 0; }
5 Answers
+ 2
Yes, you can add this line
cout << number << " ";
after your cin line
+ 1
What do you mean by that?
In Sololearn you have to give the input in advance and they are separated by new lines or spaces.
1
2
3
4
5
+ 1
What do you mean by that?
In Sololearn you have to give the input in advance and they are separated by new lines or spaces.
1
2
3
4
5
0
is it possible to make numbers to execute in a same line. Like 1 2 3 4 5?
0
thanks