TCS Company Programming Arrays

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

Read Solution (Total 12)

TCS Other Question

Predict the output of following code:
main()
{
int a=2000;
printf(ā€œ%2dā€,a); ā€‹ //format specification
}
1.2000
2. 20
3. 4000
4. Garbage value
Predict the output of following code:
main()
{
int a=10,b=20,c=5,d;
d=a