TCS
Company
Programming
Database
Predict the output of following code:
main()
{
100; // valid but no effect
printf(“%d”,100);
}
1.Error
2. 100
3. Garbage value
4. 100100
Read Solution (Total 6)
-
- 100 declare as an integer so 100 is an answer
- 6 years agoHelpfull: Yes(2) No(1)
- The answer is 100.
- 6 years agoHelpfull: Yes(2) No(1)
- ans is 100 & 100 in line 3 has no effect
- 6 years agoHelpfull: Yes(1) No(1)
- The Answer is 100
- 6 years agoHelpfull: Yes(1) No(1)
- It will produce an error since 100 is not declared as any variable.
- 6 years agoHelpfull: Yes(1) No(10)
- no error ,it is going to simply print 100
- 5 years agoHelpfull: Yes(0) No(1)
TCS Other Question