1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help me by answering this

Discussion in 'C' started by Arun kumar G, Dec 12, 2010.

?

write a program in C language without using loops but use any of other logic to find

Poll closed Jan 11, 2011.
  1. reply output as soon as possible

    0 vote(s)
    0.0%
  2. reply output as soon as possible

    0 vote(s)
    0.0%
  1. Arun kumar G

    Arun kumar G New Member

    Joined:
    Dec 12, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    write a program in C language without using loops but use any of other logic to find the output c an integer that should be multiple of one input and also closer value to another input?
     
  2. go4expert

    go4expert Moderator

    Joined:
    Aug 3, 2004
    Messages:
    306
    Likes Received:
    9
    Trophy Points:
    0
    No way. We are not here to do your homework. Show us you are ready to do this and we can help you in getting things done for you.
     
  3. Arun kumar G

    Arun kumar G New Member

    Joined:
    Dec 12, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    @coderzone i m ready to do this. i ll explain this with example if a=4 & b=37 and the output should be 36.. use any language. pls help me... i had this question in one interview..
     
  4. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    One line of code can get this done.
    int x = b/a;
     
  5. Arun kumar G

    Arun kumar G New Member

    Joined:
    Dec 12, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    @shabbir thanks for the response sir. The output value should be multiple of one input and closer(that may be greater than or less than) to the other input. But for ur code if a=7,b=38: x will be 5.42. i have to get 35 as output.
     
  6. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Sorry My mistake.

    int x= (b/a)*a

    I missed the final multiplication.
     
  7. Arun kumar G

    Arun kumar G New Member

    Joined:
    Dec 12, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    @shabbir Thank u sir... i need same type of questions. Could u post me or otherwise send me @ g.arunkumar1887@gmail.com
     
  8. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
  9. sandeep gill

    sandeep gill New Member

    Joined:
    Dec 15, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    punjab
    give me any problems.....gud one
     
  10. Arun kumar G

    Arun kumar G New Member

    Joined:
    Dec 12, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    @shabbir.. Thank u sir
     
  11. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    The pleasure is all mine.
     
  12. raji.vunnam

    raji.vunnam New Member

    Joined:
    Jan 6, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    hey we can also find it by using
    ( if & goto ) statements also yaaaaaaaaaaaaaaaaar..................
     
  13. SarahSEO

    SarahSEO New Member

    Joined:
    Jan 14, 2011
    Messages:
    25
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    SEO
    Location:
    India
    I salute you for great information
     

Share This Page