59. What will be the output of following code :
// Assume all header files are included
main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
}
A. i=0
B. i=10
C. compile time error
D. Runtime Error
View Answer & Explanation
Ans. a
Explanation : In the expression !i>14 , NOT (!) operator has more precedence than ‘ >’ symbol. ! is a unary logical operator. !i (!10) is 0 (not of true is false). 0>14 is false (zero).
60. What will be the output of following code :
// Assume all header files are included
int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
}
A. 89
B. 0
C. compile time error
D. Runtime Error
View Answer & Explanation
Ans. d
Explanation :
asserts are used during debugging to make sure that certain conditions are satisfied.