PostFix And PreFix In C


#include<stdio.h> int main() { int s=10; printf("\n The value of s is :%d",s); printf("\n The value of s with prefix is :%d",++s); //prefix printf("\n The value of s after prefix is %d",s); printf("\n The value of s with postfix is :%d",s++); //postfix printf("\n The value of s after postfix is :%d",s); return 0; }

Output:-

The value of s is :10 The value of s with prefix is :11 The value of s after prefix is 11 The value of s with postfix is :11 The value of s after postfix is :12