How can I ask for 2 numbers using the cin function in C++?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I ask for 2 numbers using the cin function in C++??

I am trying that but only ask for 1 num or not recognise the second one

7th May 2017, 7:33 PM
silvia mena
silvia mena - avatar
3 Answers
+ 6
cin>>var1>>var2 ;
7th May 2017, 7:39 PM
sowdowdow974
sowdowdow974 - avatar
+ 4
you can ask for a string input using a delimiter and then cast the string using your choice of number system. ie int, long, float, double
7th May 2017, 10:01 PM
Krishneel Nair
Krishneel Nair - avatar
+ 2
thank you very much😊
7th May 2017, 7:39 PM
silvia mena
silvia mena - avatar