Saturday, October 12, 2013

Program to show the effect of increment/decrement operator


#include<stdio.h>
#include<conio.h>
 int main( )
 {
int x;
clrscr( );
printf("\nEnter the value of x::");
scanf("%d",&x);
printf("\n x++ After the post increment is::%d",x++);
printf("\n The changed value of x is::%d",x);

printf("\n\nEnter the value of x::");
scanf("%d",&x);

printf("\n --x After the pre decrement is::%d",--x);
printf("\n The changed value of x is::%d",x);
getch();
return 0;

No comments:

Post a Comment