TCS
Company
Programming
Basics
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
Read Solution (Total 3)
-
- false
last value in the list is zero,thus else block gets executed - 6 years agoHelpfull: Yes(4) No(0)
- the ans is option 1.i.e False
- 6 years agoHelpfull: Yes(1) No(0)
- if condition will always be true answer is true
- 6 years agoHelpfull: Yes(0) No(1)
TCS Other Question