C examples for Language Basics:printf
When the increment operator is placed to the left of the variable, it will increment the variable's value by 1 first, before it's used in the expression.
#include <stdio.h> int main() //from w w w .ja v a 2s. co m { int x = 0; int y = 0; printf("\nThe value of y is %d\n", y++); printf("\nThe value of x is %d\n", ++x); return 0; }