#include<iostream.h> #include<conio.h> void main() { int x=5,y; clrscr(); y=++x; cout<<"Prefix increment \n"; cout<<"X = "<<x<<"\tY = "<<y<<endl; y=--x; cout<<"Prefix Decrement \n"; cout<<"X = "<<x<<"\tY = "<<y<<endl; y=x++; cout<<"Postfix Incremenet \n"; cout<<"X = "<<x<<"\tY = "<<y<<endl; y=x--; cout<<"Postfix Decrement \n"; cout<<"X = "<<x<<"\tY = "<<y<<endl; getch(); }
Advertisements