0

input multiple times throughout the program

Why we cannot assign two values to two int variables with just only one cin and the cout part also, like the code showed below #include <iostream> using namespace std; int main() { int a,b; cout << "Please enter 2 number"<<endl; cin>>a,b; cout<<a,b; return 0; }

19th Nov 2020, 3:38 PM
LEONG CHUN
2 Respostas
+ 2
Try using cin>>a>>b; cout<<a<<b;
19th Nov 2020, 3:39 PM
Arsenic
Arsenic - avatar
+ 1
Why we cannot assign two values to two int variables with just one in like that: in a b why??? please sign a petition to change the language please🙏
19th Nov 2020, 3:43 PM
Davide
Davide - avatar