#include<stdio.h>
#include<conio.h>
void main()
{
int a=3;
printf("Value of a: %d",a);
printf("Value of post-increment of a: %d",a++);
printf("Value of a: %d",a);
printf("Value of pre-increment of a: %d",++a);
printf("Value of a: %d",a);
printf("Value of post-decrement of a: %d",a--);
printf("Value of a: %d",a);
printf("Value of pre-decrement of a: %d",--a);
printf("Value of a: %d",a);
getch();
}
Output:-
Value of a:3
Value of post-increment of a: 3
Value of a: 4
Value of pre-increment of a: 5
Value of a: 5
Value of post-decrement of a: 5
Value of a: 4
Value of pre-decrement of a: 3
Value of a: 3
#include<conio.h>
void main()
{
int a=3;
printf("Value of a: %d",a);
printf("Value of post-increment of a: %d",a++);
printf("Value of a: %d",a);
printf("Value of pre-increment of a: %d",++a);
printf("Value of a: %d",a);
printf("Value of post-decrement of a: %d",a--);
printf("Value of a: %d",a);
printf("Value of pre-decrement of a: %d",--a);
printf("Value of a: %d",a);
getch();
}
Output:-
Value of a:3
Value of post-increment of a: 3
Value of a: 4
Value of pre-increment of a: 5
Value of a: 5
Value of post-decrement of a: 5
Value of a: 4
Value of pre-decrement of a: 3
Value of a: 3
No comments:
Post a Comment