TCS Company Programming Output

What could be the output for following?
main()
{
int a= - - 2;
printf(ā€œ%dā€,a);
}
1. 2
2. -2
3. 1
4. Error

Read Solution (Total 11)

TCS Other Question

Is there any difference between following declarations?
A : extern int fun();
B : int fun();
1.Both are identical
2.No difference, except extern int fun(); is probably in another file
3.int fun(); is overrided with extern int fun();
4.None of these
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