can some one elaborate the use of 'cin'. How we can use it in a more practical way? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can some one elaborate the use of 'cin'. How we can use it in a more practical way?

30th Sep 2016, 5:00 PM
Yonatan Girma
Yonatan Girma - avatar
3 Answers
0
the cin command is used as to read input and no format specifiers needed for this.
30th Sep 2016, 6:16 PM
surjithChitra
surjithChitra - avatar
0
The cin command is used for user in put for example main() { int a; int b=10; cout << "yonatan please write any number below 10 in order to subtract your number from 10"; //cin allows you to enter a number cin >> a; int sum = b - a; cout << "sum"; /* without cin there is no user input,you can not enter a number*/ return 0; }
30th Sep 2016, 7:52 PM
knowledge
0
You can use cin in order for the user to input and well the command cin reads the user input
30th Sep 2016, 7:54 PM
knowledge