+ 4
What to type when asked to split multiple inputs into separate lines
2 ответов
+ 4
That varies from code to code. You must know the no. of Inputs the program will require beforehand. Depending on the no. of inputs required you have split them in equal no. of lines.
for e.g.
..
..
..
int a;
cin>>a;
cout<<a;
int b;
cin>>b;
cout<<b;
int c;
cin>>c;
cout<<c;
return 0; }
The given code snippet has three inputs. So you must split the inputs into 3 lines while running like
2
4
6
The value is assigned in the same order.
So , after running
a=2
b=4
c=6
+ 1
You write in the inputs you want the user to enter. So imagine you are the user, and you're entering in the numbers that is wanted in the code. If its a while loop and its wanting 10 numbers, enter 10 numbers like this:
1
2
3
4
5
6
7
8
9
10
and then press "Enter" to run the code with those numbers.