What will be the output of the following C code?
#include <stdio.h>
main()
{
int a = 1;
printf("size of a is %d, ", sizeof(++a));
printf("value of a is %d", a);
};
#include <stdio.h>
main()
{
int a = 1;
printf("size of a is %d, ", sizeof(++a));
printf("value of a is %d", a);
};
A. size of a is 4, value of a is 1
B. size of a is 4, value of a is 2
C. size of a is 2, value of a is 2
D. size of a is 2, value of a is 2
Answer: Option A
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion