what is the output for
printf("ab","dc","ef");
printf(%d,10?0?5:5:1:12);
Small questions in C-language?
The first will just output ab. There are no placeholders (%s, %d, etc.) in the formatting string ("ab"), so the remaining parameters ("dc" and "ef") have no effect.
The second is not a valid C statement. Even if you put the %d in quotes, 10?0?5:5:1:12 is not valid.
If, for the sake of an example, you had:
printf("%d",10?0?5:1:12);
then you'd get 1 as the output. This is because 0?5:1 evaluates to 1, so the equivalent is 10?1:12, which evaluates to 1 as well.
Reply:It wouldn't compile.
parts of a flower
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment