TCS
Company
Programming
Basics
Predict the output of following code:
main()
{
if( printf(“Hai”)) // prints content of printf statement and
//takes length of the string for if case
//execution in this case
its 4, So true
printf(“Face”);
else
printf(“Focus”);
}
1. Error
2. HaiFace
3. HaiFocus
4. Face
Read Solution (Total 4)
-
- answer should be HaiFace
- 6 years agoHelpfull: Yes(3) No(0)
- First it will print hai , if condition true so it wil print face
Ans:haiface - 6 years agoHelpfull: Yes(1) No(0)
- output: HaiFace
- 5 years agoHelpfull: Yes(1) No(0)
- Inside the if block hai print hai iside if block then length of hai is 3 it will enters inside the it will execute print statement
Output:Haiface - 3 years agoHelpfull: Yes(0) No(0)
TCS Other Question