-->

cin and cout

cin and cout

What is cin and cout?
Cin and cout is an object. Cin and cout are into the library iostream.h
Cin is equivalents to the scanf() and cout is equivalents to the printf()
Print the value of variable we use cout<< and to get the value from user we use cin>>.
Example:
Cout<<”ans=”<<ans;
Cin>>a;


  Explain insertion and extraction operator. or
  Explain input and output operator.
    Insertion operator:
Sign of the insertion operator is, <<.
Insertion operator is also knows as put to operation.
This operator is used with the keyword cout, which represents the standard output stream.
The insertion operator inserts (on sends) the contents of the variable on its right to the object on its left.
Example:
cout << string:
It displays the value of valuable string on the screen.

Extraction operator:
The sign of the extraction operator is >>.
This operator is also known as get from operator
This operator is used with cin, which represents the
Examples:
cin >> number1,
     user inputs the value 45.5, which is stored in to the variable number1.
Is an input statement and cause the program to wait for the user to type in a number.
It extracts (or takes) the value from the keyboard and assigns it to the variable on its right.