A. | Result in a syntax error |
B. | Outputs tim3 |
C. | Outputs garbage |
D. | Prints tim and terminate abruptly |
Option: B Explanation : Click on Discuss to view users comments. |
A. | A syntax error |
B. | Garbage Values |
C. | Segmentation violation |
D. | Printing of 3 |
Option: D Explanation : Click on Discuss to view users comments. |
What does the statement,
printf("%d",10?0?5:1:12);
prints :
A. | 10 |
B. | 5 |
C. | 12 |
D. | 1 |
Option: D Explanation : It will print '1' as : operator states that either first or second condition true. Click on Discuss to view users comments. jagadeesh said: (6:27pm on Tuesday 30th May 2017)
here the statement is false when 0 and true in remaining all cases the logic in the question can be rewritten as 10?(0?5:1):12 here 10 is true so 0?5:1 is executed and 0 is false so 1 is returned
|