C problem

vamsi_51

vamsi_51

@vamsi-51-OxiEba Oct 25, 2024
[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......................

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • ish_nalini

    ish_nalini

    @ish-nalini-lT8U2a Dec 3, 2006

    hey i think so it must be: %%%%%%%%%%%


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

    pad

    @pad-cAxwqR Dec 11, 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

    @ish-nalini-lT8U2a 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

    @pranny-yzubkU Dec 13, 2006

    The output is %%%%%...

    cause has already been posted
  • ish_nalini

    ish_nalini

    @ish-nalini-lT8U2a 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

    @pad-cAxwqR 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

    @dep-Xne9ZU 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.