There are four purposes of using cout.

  1. prints output sentence on screen
    • Example:
    cout<<"Hello World";
  2. prints new line on screen
    • Example:
            cout<<endl;  or
            cout<<"\n";
            
  3. prints number on screen
    • Example:
    cout<<100;
  4. prints the value of a variable on screen
    • Example:
            int x=100;
            cout<<x;
            

Leave a Reply

Your email address will not be published. Required fields are marked *