C Language

May 21, 2023

Postfix increment decrement in C Language

Program use increment decrement in C Language


#include <stdio.h>
int main()
{
    int x = 8;
    printf("x=%d\t", x);
    printf("x=%d\t", x++);
    printf("x=%d\t", x);
    printf("x=%d\n", x--);
    printf("x=%d\n", x);
    return 0;
}

output


x=8  x=8  x=9  x=9  x=8  

by : Nadeem Khan

Quick Summary:

Program use increment decrement in C Language copy #include <stdio.h> int main() { int x = 8; printf(“x=%d\t”, x); printf(“x=%d\t”, x++); printf(“x=%d\t”, x); printf(“x=%d\n”, x–); printf(“x=%d\n”, x); return 0; } output x=8 x=8 x=9 x=9 x=8