TCS Company Programming Output

Predict the output of following code:
main()
{
int i=10;
printf(“%d,%d”,++i,++i);
}
1. 11,12
2. 12,11
3. 10,11
4. 11,10

Read Solution (Total 11)

TCS Other Question

Predict the output of following code:
main()
{
int i=10,j=2,k=0,m;
m=++i&&++j&&++k; // m = 11 && 3 && 1 = 1
printf(“%d%d%d%d”,i,j,k,m);
}
1.11,3,1,1
2. 11,2,0,1
3. 11,3,1,0
4. 10,2,0,1
Predict the output of following code:
main()
{
int a,x=(2,3,4,5); //valid statement x = last value in list
// x = 5 during declaration list
should be specified inside ( )
a=1,2,3,4,5; // valid; a = 1; first value of the list is
assigned to variable
printf(“%d%d”,x,a);
}

1. Error
2. 5,1
3. 2,1
4. 5,5