conditional-statement

Question 1

What is the output of the following program ?

#include

int main()

{

if(printf ("ABC")) printf ("True") ;

else printf("False");

return 0;

}
A
Compilation error
B
ABC
C
ABCTrue
D
ABCFalse
Question 1 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
There is 1 question to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access