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;
}
Compilation error | |
ABC | |
ABCTrue | |
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.
