0
What is cin used for in c++
6 ответов
+ 11
E.g.
int x; // initialise variable
cin >> x; // user input to variable
cout << x; // outputs variable to console
cout : console output
cin : console input
+ 3
to get user input
+ 2
so cin is used to give information about the variable
+ 2
thxxx every one
+ 1
when we use cout to get the value of our program so why there is a need for cin
+ 1
cin is the standard input stream object, which retrieves console input. It is tied to, but distinct in purpose from, cout, the standard output stream, which prints to the console.
Simply stated, cin gets user input, whilst cout displays output to the user.