C Program : Prefix and Postfix Increment (++) Operator

 #include <stdio.h>

int main() { int x = 5; int y, z; // Prefix increment operator (++x) y = ++x; // First increment x, then assign it to y // Postfix increment operator (x++) z = x++; // First assign x to z, then increment x printf("x: %d\n", x); // x = 7 printf("y: %d\n", y); // y = 6 printf("z: %d\n", z); // z = 6 return 0; }

Comments

Popular posts from this blog

Video Formats

Where video editing is used

File saving and folder management