1)
What is the output of the following program?
#includeint main() { int i; i = 10; printf("i : %d\n",i); printf("sizeof(i++) is: %d\n",sizeof(i++)); printf("i : %d\n",i); return 0; } Solution: 10 4 10 Reason the value of i at the second printf is still 10 is because operation performed inside the sizeof operator doesn't change the value of i. The 'sizeof' operator is used to determine the amount of space any data-element/datatype occupies in memory
No comments:
Post a Comment