How does the user insert text? | SoloLearn: Learn to code for FREE!

0

How does the user insert text?

c++

6/3/2020 6:40:21 PM

Matthew

5 Answers

New Answer

+3

Aman Kumar cin is "console" input not "character" input.

+2

Use string data type string text; cin >> text; cout << text;

+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; }

+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.

+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.