How can we use cout & cin functions? Give the a suitable program. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How can we use cout & cin functions? Give the a suitable program.

14th Sep 2016, 8:08 PM
saumya mishra
6 Answers
+ 2
#include <iostream> using namespace std; int main() { string s; int n; cout << "Please type a word" << endl; cin >> s; cout << "You entered: " << s << endl; cout << "Please type a number" << endl; cin >> n; cout << "You entered: " << n << endl; return 0; }
14th Sep 2016, 8:33 PM
Zen
Zen - avatar
+ 1
cout ia used for giving output while cin is used to take input
15th Sep 2016, 3:47 AM
Saransh Agarwal
Saransh Agarwal - avatar
+ 1
cout"<<" where u can print data to the user cin">>" where u can get the input data from the user
15th Sep 2016, 1:01 PM
Shan Balan
Shan Balan - avatar
0
cout is a command that is used to output compiled information on the screen cin is used to feed in data into the compiler
15th Sep 2016, 1:12 PM
Obed
0
you can use cout in a void function
27th Sep 2016, 9:11 PM
Ayin GhaziMoradi
0
simple cout is output and cin is input thats it.....
13th Aug 2017, 3:50 AM
Shan Balan
Shan Balan - avatar