input and output un C++ code example
Example 1: C++ user input
int x;
cout << "hurry, give me a number!: "; // Type a number and press enter
cin >> x; // Get user input from the keyboard
cout << "you picked: " << x << " !" // Display the input value
OR use:
getline >> (cin, variable-name);
instead of
cin >> x;
Example 2: how to cout in c++
std::cout << "Hello World!" << std::endl; //Or you can do
std::cout << "Hello World!" <<; //Only in some scenarios