#include<stdio.h>
int main()
{
int p=6;
p=p++;
p=p*10-20;
printf("%d is p",p);
return 0;
}
Here, If i compiled the program i will get the output 40. But if I tried to calculate output myself, I will get a wrong result i.e 50. In the line p=p++; I assigned the value 6 to p first and then incremented it to 7. Since the incremented value will also be assigned to p, then shouldnot we use the incremented one rather than the earlier value?