View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12763 Members
Join this group to post and comment.
vamsi_51
vamsi_51 • Nov 30, 2006

C problem

[FONT="]#include[/FONT]
[FONT="] main()[/FONT]
[FONT="] {[/FONT]
[FONT="] clrscr();[/FONT]
[FONT="] printf(“%%%%%%%%%%%”);[/FONT]
[FONT="] getch();[/FONT]
[FONT="] }[/FONT]

What is the Output ?
Give Reason also......................
ish_nalini
ish_nalini • Dec 4, 2006
hey i think so it must be: %%%%%%%%%%%


reason : printf prints as it is given inside the " "
pad
pad • Dec 12, 2006
%%%%%

i.e. 5% as %% becomes % when used in printf as % is special here and is escaped. last % doesnt find a matching % so doesnt get printed.
ish_nalini
ish_nalini • Dec 13, 2006
pad
%%%%%

i.e. 5% as %% becomes % when used in printf as % is special here and is escaped. last % doesnt find a matching % so doesnt get printed.
Excellent pad really thats a great Solution .. i hav not thinked about that ......Please keep posting these kind of brain killing posts
Pranny
Pranny • Dec 13, 2006
The output is %%%%%...

cause has already been posted
ish_nalini
ish_nalini • Jan 20, 2007
Hello guys,
I found the answer for this problem to be "%%%%%%"in Turbo C compiler...Any one to reason it??????
pad
pad • Jan 24, 2007
ish_nalini
Hello guys,
I found the answer for this problem to be "%%%%%%"in Turbo C compiler...Any one to reason it??????
yes!

specifications are not always implemented in products...
find a true ANSI compliant version and try again
DEP
DEP • Feb 27, 2007
pad
yes!

specifications are not always implemented in products...
find a true ANSI compliant version and try again

hi pad,

dont have ANSI compiler. So how about this idea of mine. You tell what is the anwer in ANSI compiler and i will try figure out the reason.

Share this content on your social channels -