+ 2

How to take input in the form of text(line) and print it?

Input in form of text line

17th Jul 2017, 1:01 PM
Yash Singhal
Yash Singhal - avatar
3 Antworten
+ 6
use cin to get user input. use cout to print to screen. i.e #include <string> using namespace std; int main() { string input; cout << "enter text"; cin >> input; cout << "you entered " << input; return 0; }
17th Jul 2017, 1:57 PM
jay
jay - avatar
+ 5
the language you are using might help in getting a correct answer
17th Jul 2017, 1:03 PM
jay
jay - avatar
+ 3
cin.getline(a)//say a is of int type cout<<a;
17th Jul 2017, 1:55 PM
dhruv tewari
dhruv tewari - avatar