May 26, 2023
program to use prefix increment decrement in c language
#include<stdio.h>
int main()
{
int a=6;
printf("a=%d\t",a);
printf("a=%d\t",++a);
printf("a=%d\t",a);
printf("a=%d\t",--a);
printf("a=%d\n",a);
return 0;
}
output
a=6 a=7 a=7 a=6 a=6
Steps Description
- Declare integer variable
a=6
- Initialize in integer variable
a=6
printf
inbuild function to display value of variable a in decimal placeholder %da = 6
for
formatting tab separator \t is usedprintf
inbuild function to display prefix increment values variable a in decimal placeholder
%da = 7
for formatting tab separator \t is usedprintf
inbuild function to display value of variable a in decimal placeholder %da = 7
for
formatting tab separator \t is usedprintf
inbuild function to display prefix decrement values variable a in decimal placeholder %da = 6
for formatting tab separator \t is usedprintf
inbuild function to display value of variable a in decimal placeholder %da = 6
for
formatting tab separator \t is used
by : Ajaj Khan
Quick Summary:
use prefix increment decrement in c language