+ 2

Say whether it's right or not and say the right answer

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

20th Jun 2018, 1:58 PM
‏‪Suppa Shanmana‬‏
‏‪Suppa Shanmana‬‏ - avatar
6 ответов
+ 4
Suppa Shanmana #include <stdio.h> void main() { if (printf(" ")) printf("\n Suppa"); else printf("Shanmana"); } not just easy as show on code i belive when if check if (printf(" CSE ")) as printf the number of characters printed and cse return 3 and in In C, the value nonzero is true while zero is taken as false and if condition true and print suppa but in>> if (printf("")) printf("\n Suppa"); on if statement printf return 0 as false in c and goes to else part and print Shanmana hope u understand i post some link as prove of rules of c https://stackoverflow.com/questions/13588320/what-is-the-return-type-of-printf www.java2s.com/Tutorial/C/.../InCthevaluenonzeroistruewhilezeroistakenasfalse.htm
20th Jun 2018, 2:17 PM
Scooby
Scooby - avatar
+ 6
it's executing means program is correct but what you wanna do here?
20th Jun 2018, 2:02 PM
Deepak Kumar
Deepak Kumar - avatar
+ 4
welcome ☺
20th Jun 2018, 2:22 PM
Scooby
Scooby - avatar
+ 1
thanks Scooby 😉😊
20th Jun 2018, 2:21 PM
‏‪Suppa Shanmana‬‏
‏‪Suppa Shanmana‬‏ - avatar
+ 1
printf statements output to text to the screen (I think technically to stain not sure) and returns the number of characters printed so yes I suppose it should work but its not really its intended function
21st Jun 2018, 2:39 PM
Rational Agent
0
what's the use of printf stmt and my doubt is that in if stmt can we use printf stmts??
20th Jun 2018, 2:07 PM
‏‪Suppa Shanmana‬‏
‏‪Suppa Shanmana‬‏ - avatar