TCS
Company
Programming
Puzzles
What is the output for following?
main()
{
printf(“%%%%”);
}
1. %%%%
2. %%
3. Error
4. Garbage Value
Read Solution (Total 16)
-
- The answer is %% 2 times only. As % is exit delimiter so to print % itself we have to mention it twice for 1-time printing.
- 6 years agoHelpfull: Yes(16) No(2)
- output is 2. i.e. %% it will print two times
- 6 years agoHelpfull: Yes(6) No(0)
- ans 3.Error
- 6 years agoHelpfull: Yes(2) No(4)
- Output is %%%%
- 6 years agoHelpfull: Yes(1) No(5)
- to print % once we have to give it two times to print one so the o/p will be option (2)%%
- 6 years agoHelpfull: Yes(1) No(0)
- %%
%d%d...replace d with % - 6 years agoHelpfull: Yes(1) No(0)
- garbage value
- 6 years agoHelpfull: Yes(0) No(1)
- Option 1 because printf prints the information in between the double qoutes
- 6 years agoHelpfull: Yes(0) No(3)
- Answer is option 2 because of delimeters both of %% it will take one %.so four %%%% it takes two %%.
- 6 years agoHelpfull: Yes(0) No(0)
- it gives you an error
- 6 years agoHelpfull: Yes(0) No(1)
- The output is %%
- 6 years agoHelpfull: Yes(0) No(0)
- %% will be output this question because we are executing this programm.
- 6 years agoHelpfull: Yes(0) No(0)
- printf will print the characters within " ".So ans is option 1
- 6 years agoHelpfull: Yes(0) No(0)
- Ans : %%
Because : Delimeters both of %% it will take one %.so four %%%% it takes two %%. - 6 years agoHelpfull: Yes(0) No(0)
- 2 times %%
- 5 years agoHelpfull: Yes(0) No(0)
- If the statement given with apaspere with with print statement it will print the same statement
Output:%%%% - 3 years agoHelpfull: Yes(0) No(0)
TCS Other Question