51. What will be the output of following code :
// Assume all header files are included
main()
{
int a[10];
printf("%d",*a+1-*a+3);
}
A. 3
B. 4
C. 1
D. Runtime Error
View Answer & Explanation
Ans. b
Explanation : a and –a cancels out. The result is as simple as 1 + 3 = 4 !
52. What will be the output of following code :
// Assume all header files are included
main()
{
int i=5;
printf("%d",++i++);
}
A. 89
B. 0
C. compile time error
D. Runtime Error
View Answer & Explanation
Ans. c
Explanation : ++i yields an rvalue. For postfix ++ to operate an lvalue is required.
