C
Programming and Technical
Programming
Program
What will be the output of the program?
#include
int main()
{
char str[]="C-program";
int a = 5;
printf(a >10?"Psn":"%sn", str);
return 0;
}
Options
1) C-program
2) Ps
3) Error
4) None of above
Read Solution (Total 3)
-
- option: 3 (Error) becoz #include is not complete, library is not imported.
- 3 years agoHelpfull: Yes(1) No(0)
- Answer:1
- 8 years agoHelpfull: Yes(0) No(1)
- printf(a>10?"Psn":"%s",str)
ternary operator is using in printf a>10 since a=5 the condition is false %s statement is print which is "C-program" - 4 years agoHelpfull: Yes(0) No(1)
C Other Question