TCS Company Programming Definition

Predict the output of following code:
main()
{
int a=2000;
printf(“%2d”,a); ​ //format specification
}
1.2000
2. 20
3. 4000
4. Garbage value

Read Solution (Total 14)

TCS Other Question

Predict the output of following code:
main()
{
printf(“FACE”+2); ​ // valid skip specified number of
//characters from start
}
1. FACE
2. FA
3. CE
4. Garbage value
Predict the output of following code:
main()
{
int x,a=10;
x=a==10?printf("hait"):printf("hellon");
printf("%d",x);
}
1.hai 4
2. Error
3. hello 3
4. hai hello