How to chain ore than 1 input in singke statement ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to chain ore than 1 input in singke statement ??

16th Nov 2016, 6:17 PM
Udit Saraswat
Udit Saraswat - avatar
3 Answers
+ 1
cin >> a >> b; User can enter inputs one line at a time (input, enter, input, enter), or they can enter inputs all on one line (separated by spaces).
20th Nov 2016, 1:48 PM
Cohen Creber
Cohen Creber - avatar
0
Ex: cin<<x<<y<<z; Above example takes 3 inputs, in the same way, you can give as many inputs as you want in a single statement.
16th Nov 2016, 7:48 PM
Avinash Bommidi
Avinash Bommidi - avatar
0
you better specify to user in your code that you expect him to input 3 times one after another before he hits enter key otherwise you might get an error if he inputs just one time and hits enter 😊, just saying 😊
19th Nov 2016, 10:13 AM
Mielu
Mielu - avatar