C++ - Cout .

In this session i have discussed the cout in C++ .


cout<<"Hello World"

The cout is an object of the standard output stream . This << symbol is called the insertion operator or put to operator . It is used to send the value of variable right to object left . The whole statement display the value on screen or other device . We will discuss later in details .

The cout work like printf() function in C . But cout is not a function .


Example : Write a program that print the message on to screen .

    #include<iostream.h>
    using namespace std;
    int main()
    {
        int a=20;
        cout<<"Hello World";
        cout<<a;
        return 0;
    }
    
    OUTPUT : Hello World
             20
    

Welcome to AndroidATPoint.

back image                     next image