/*program explaining increment and decrement operators*/
#include<stdio.h>#include<conio.h>
Int main()
{
Int a,b,c,d,e,f;
clrscr();
printf(“enter a,b values”);
scanf(“%d%d”,&a,&b);
++a;
++b;
printf(“\na=%d,b=%d”,a,b);
c=++a;
d=b++;
printf(“\nc=%d,d=%d”,c,d);
e=--c;
f=d--;
printf(“\ne=%d,f=%d”,e,f);
getch();
return 0;
}
output
enter a,b values44
a=4,b=5
c=6,d=5
e=5,f=5
Comments
Post a Comment