How does the user insert text? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How does the user insert text?

3rd Jun 2020, 6:40 PM
Matthew
3 Answers
+ 1
If you're dealing with console app, you need to look for cout<< for output and cin>> for user input Here's an example #include <iostream> using namespace std; int main () { int age; cout << "Please enter your age"; cin >> age; cout << "Your age is:" << age; return 0; }
3rd Jun 2020, 7:01 PM
HNNX 🐿
HNNX 🐿 - avatar
+ 1
cin >> is used to take input from the user. Simple meaning ("c")console ("in")input. And the extraction operator points towards cin in order to receive a stream of characters. Library needed iostrem. And examples are there only provided by above people.
4th Jun 2020, 4:30 AM
Aman Kumar
Aman Kumar - avatar
+ 1
If you want to add a character . Then do it like this . Char a; Cin>>a; And integers. Int N; Cin>>N; If you add any datatype you must need to include cin then you we'll be able to insert it.
5th Jun 2020, 2:21 PM
Naveed
Naveed - avatar