{ int i; if(printf("0")) i=12; else i=13; printf("%d\n",i); return 0; } how the op is 012?? | Sololearn: Learn to code for FREE!

+1

{ int i; if(printf("0")) i=12; else i=13; printf("%d\n",i); return 0; } how the op is 012??

I have not been able to understand the program.

2/5/2020 12:23:46 PM

Muskan Mishra

4 Answers

New Answer

+1

printf function returns no. Charecter outputted.. printf("0") print 0, and the number of charecters outputted is 1, so if block executed... Print 12 So total output is 012

+1

https://code.sololearn.com/c3GfowiDl09K/?ref=app

+1

Well explained by Jayakrishna

-1

Please put your code in Code Playground.