Course


Input and Output

Learn to use the cin object to take input from the user, and the cout object to display output to the user

C++ Output

In C++, cout sends formatted output to standard output devices, such as the screen. We use the cout object along with the < < operator for displaying output.

C++ (GCC 9.2.0)
  • Input  

To print the numbers and character variables, we use the same cout object but without using quotation marks.

C++ (GCC 9.2.0)
  • Input  

C++ Input

In C++, cin takes formatted input from standard input devices such as the keyboard. We use the cin object along with the >> operator for taking input.

C++ (GCC 9.2.0)
  • Input  

Please click on the input switch to see the input [A and 7].

Video credit: Derek Banas

C++ Scientific Programming