Tuesday 7 July 2015

Use of cout in C++ :

Cout Operator in C++ Insertion Operator
  • cout is used for displaying data on the screen.
  • The operator << called as insertion operator or put to operator.
  • Insertion operator is similar to the printf() operation in C.
  • cout is the object of ostream class.

Example of cout :

         void main(){
            int a=10;
            int b=20;
         cout<<a<<b;

is similar to -

     cout<<a;
     cout<<b;

Output:

          1020

No comments:

Post a Comment