vamsi_51
vamsi_51
Branch Unspecified
27 Feb 2007

C problem

[FONT=&quot]#include<stdio.h>[/FONT]
[FONT=&quot] main()[/FONT]
[FONT=&quot] {[/FONT]
[FONT=&quot] clrscr();[/FONT]
[FONT=&quot] printf(“%%%%%%%%%%%”);[/FONT]
[FONT=&quot] getch();[/FONT]
[FONT=&quot] }[/FONT]

What is the Output ?
Give Reason also......................
ish_nalini

ish_nalini

Branch Unspecified
12 years ago
hey i think so it must be: %%%%%%%%%%%


reason : printf prints as it is given inside the " "
pad

pad

Branch Unspecified
12 years ago
%%%%%

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

Branch Unspecified
12 years ago
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

Branch Unspecified
12 years ago
The output is %%%%%...

cause has already been posted
ish_nalini

ish_nalini

Branch Unspecified
12 years ago
Hello guys,
I found the answer for this problem to be "%%%%%%"in Turbo C compiler...Any one to reason it??????
pad

pad

Branch Unspecified
12 years ago
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

Branch Unspecified
12 years ago
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 -

Only logged in users can reply.