0
How to input int and string datatype in one line?
2 Réponses
+ 3
Ayshi below is the one :
int a;
string b;
cin >> a>> b;
cout << a << endl << b;
0
If you want to input a number with message in one line you should not to put std:: endl or \n at the end of the message.
cout << "Input integer number :";
int n =0;
cin >> n;