Thursday 17 October 2013

CPP Program to Understand of Increment and Decrement Operator

//Write a program to understand of increment(++) and decrement(--) operator.
#include<iostream.h>
#include<conio.h>
void main()

{
 int i;
 clrscr();
 i=10;
 cout<<"\i   -"<<i;
 cout<<"\ni++ -"<<i++;
 cout<<"\n++i -"<<++i;
 cout<<"\n--i -"<<--i;
 cout<<"\ni-- -"<<i--;
 getch();
}

Output:

No comments:

Comments System