//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:
Post a Comment