Some more questions.

Discussion in 'C' started by meyup, May 24, 2010.

  1. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    First Program
    Assume the input values as 55,67,90 then what will be the output of this program?
    What will be the output?

    Third Program
    What will be the output?
     
  2. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    Try to say all the answers without running the program.
     
  3. creative

    creative New Member

    Joined:
    Feb 15, 2010
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    For the first program, the output might be :

    a= 55.
    b= maybe 0 or 67 or 670.
    c= 90.
     
  4. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0

    Wrong answer.Try it
     
  5. creative

    creative New Member

    Joined:
    Feb 15, 2010
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    The second one I think will beep after every letter then write the whole word.
    The first one I think the output will be 55, 4489 and 90 (but I'm pretty sure I'm wrong)
    And the third one is possibly 2.5

    I'm only sure about the second one
     
  6. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    Its not the correct answer but good for trying.
     
  7. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    The bbcode for Code in post is CODE and not QUOTE.
     
  8. Prakhar14

    Prakhar14 New Member

    Joined:
    Apr 27, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    For the first program the output will be 55 and 67 because we can't initialize b as we have used * between % and b.

    Second one has been given by others.

    For the third problem, the output will be 2.500000.
     
  9. raji.vunnam

    raji.vunnam New Member

    Joined:
    Jan 6, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    second and third qns ...........k ansr clear but giv me the reason for the first one.........

    i didn't get it......... y its happening like that .....bcoz even we remove b from printf also its printing some value ....... by leaving c value

    my id raji.vunnam@gmail.com
     
  10. Prakhar14

    Prakhar14 New Member

    Joined:
    Apr 27, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    u got the value of b 'cause although b has not been initialized, it points to a memory location; that's why contain some garbage value.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice