TCS Company Programming Puzzles

What is the output for following?
main()
{
printf(“%%%%”);
}

1. %%%%
2. %%
3. Error
4. Garbage Value

Read Solution (Total 16)

TCS Other Question

Predict the output of following code:
main()
{
float a=1.1;
double b=1.1;
if(a==b) // datatype is different cant be compared; hence result will be 0
printf(“equal”);
else
printf(“not equal”);
}

1. ​ equal
2. not equal
3. Error
4. equal not equal
main()
{
printf(“%d”);
}
1. 0
2. 1
3. Garbage value
4. Error