Input and Output in C++
To input and output information to the console in C++, you will use the standard input-output stream (iostream) library.
To output information, you will use the code std::cout. This code is referencing the standard output stream. In most cases, the output device is the display screen.
Here is an example with the classic Hello World! program.
To input information, you will use the code std::cin. This code is referencing the standard input stream. In most cases, the input device is a keyboard.
Here is an example program where the user is asked to input their name and it will get displayed back with a greeting.