Programming

Input and Output Operators In C++

Input and Output Operators In C++

There are basically on input operator and one output operator in C++.

The input operator is called cin.
The output operator is called cout.

cin:

cin is the iostream library operator which is used to take input from the user on the console. It can take input at the run time (at any time whenever you want) of the program.

EXAMPLE-1 :

in this code user can enter any integer number because to our int datatype of the variable.


OUTPUT:

Taking first input in this 2 is entered by the user as he can enter any integer value.

After that the second input is taken by the use.

in this user has entered 4.

EXAMPLE-2 :

in this code user can enter any charcter number because to our char datatype of the variable.


OUTPUT:

Taking first input in this A is entered by the user as he can enter any charcter value.

Taking second input in this B is entered by the user.

cout:

cout is the iostream library operator which is used to give output to the user on the console. It can take output on the console at the run time (at any time whenever you want) of the program.

EXAMPLE-1 :


OUTPUT:

the programs displays HELLO and then endl break’s the line and then HOW ARE YOU is displayed.

For More Examples Of COUT visit article :: https://proteacharticles.com/2019/12/18/hello-world-program-in-c/

2 Comments

2 Comments

  1. cbd lube

    May 6, 2020 at 9:29 am

    amazing

  2. buy youtube subscribers

    May 10, 2020 at 4:28 pm

    amazing

Leave a Reply

Your email address will not be published.

Most Popular

To Top