TCS Company Programming Basics

Predict the output of following code:
main()
{
if(5,4,3,2,1,0,8,​ 9 ​ ) // Last value of list is considered
printf(“True”);
else
printf(“False”);
}

1. True
2. False
3. True False
4. Error

Read Solution (Total 7)

TCS Other Question

Predict the output of following code:
main()
{
if(5,4,3,2,1,​ 0 ​ ) // Last value of list is considered
printf(“True”);
else
printf(“False”);
}
1. True
2. False
3. True False
4. Error
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