35. What will be the output of following code :
// Assume all header files are included
main()
{
int c=- -2;
printf("c=%d",c);
}
A. c=2;
B. c=-2;
C. c=++2;
D. Runtime Error
View Answer & Explanation
Ans. a
Explanation : Here unary minus (or negation) operator is used twice. Same maths rules applies, ie. minus * minus= plus.
36. What will be the output of following code :
// Assume all header files are included
main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}
A. bai
B. lai
C.hai
D. Runtime Error
View Answer & Explanation
Ans. c
Explanation :
\n – newline
\b – backspace
\r – linefeed
