TCS
Company
Programming
Predict the output of following code:
main()
{
int i=-1;
-i;
//No change in value of i
printf(“%d,%d”,i,-i);
}
1. -1, 1
2. -1, -1
3. 1, 1
4. 0, 1
Read Solution (Total 5)
-
- answer is -1 ,1
- 6 years agoHelpfull: Yes(7) No(0)
- answer is 2
- 6 years agoHelpfull: Yes(1) No(1)
- answer is -1,1
- 6 years agoHelpfull: Yes(1) No(0)
- The ans is option 1.
- 6 years agoHelpfull: Yes(0) No(0)
- option 1 is right i.e. -1,1
- 6 years agoHelpfull: Yes(0) No(0)
TCS Other Question