C++ User Input

C++ User Input


Define :
We can use object cin to get user input. cin stands for character input .The cin object is used along with the extraction operator >> in order to receive a stream of characters.
In the following example, the user can input a number, which is stored in the variable a. Then we print the value of a:

Output :

We can use object cin to get user input. cin stands for character input .The cin object is used along with the extraction operator >> in order to receive a stream of characters.

In the following example, the user can input a number, which is stored in the variable a. Then we print the value of a:

Output :