+ 2
Say whether it's right or not and say the right answer
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
+ 6
it's executing means program is correct but what you wanna do here?
+ 4
welcome ☺
+ 1
thanks Scooby 😉😊
+ 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
0
what's the use of printf stmt and my doubt is that in if stmt can we use printf stmts??