Mathematical-Reasoning
December 12, 2024Relational-Algebra
December 13, 2024HCU PHD CS MAY 2016
|
Question 13
|
What is the output of the following program ?
#include
int main()
{
if(printf (“ABC”)) printf (“True”) ;
else printf(“False”);
return 0;
}
|
Compilation error
|
|
|
ABC
|
|
|
ABCTrue
|
|
|
ABCFalse
|
Question 13 Explanation:
Inside the condition of if printf(“ABC”) will return 3 and we know that in if condition anything other than 0 is considered true so it will enter the if loop and will print Tue.Also before that ABC will get printed due to printf(“ABC”). So in total ABCTrue will get printed
Correct Answer: C
Question 13 Explanation:
Inside the condition of if printf(“ABC”) will return 3 and we know that in if condition anything other than 0 is considered true so it will enter the if loop and will print Tue.Also before that ABC will get printed due to printf(“ABC”). So in total ABCTrue will get printed
