Increment Operator in C++

#include <iostream.h>
int main()
 {
 int c;
 c = 5;
 cout << c << endl; 
 cout << c++ << endl; 
 cout << c << endl << endl; 
 c = 5;
 cout << c << endl; 
 cout << ++c << endl; 
 cout << c << endl; 
 return 0; 
 }
 OUTPUT:
         5
5
6

5
6
6

No comments:

Post a Comment