cout and cin

cout<<: cout is used for print message on screen

Example

 
#include<iostream.h>
#include<conio.h>

void main() 
{  
 int num;  
 clrscr();  
 cout<<"Hello word !";  // print message on screen
 getch();  
}  

Output

 
Hello word !

cin

cin>>: cin is used for get or read value form keyboard.

Example

 
#include<iostream.h>
#include<conio.h>

void main() 
{  
 int num;  
 clrscr();  
 cout<<"Enter any number:";
 cin>>num;  // accept one value form keyboard
 cout<<"Number is: "<<num;
 getch();  
}  

Output

 
Enter any number :100
Number is: 100