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

Reverse roots

Discussion in 'C' started by Yogicena, Jan 23, 2007.

  1. Yogicena

    Yogicena New Member

    Joined:
    Jan 23, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I came across a problem where i have to accept N number of fields and print the square root of all these numbers in reverse order.I may be given numbers which may be separated or given in sequential order.For example My input willbe
    36
    0
    4
    and my output should be
    6.0000
    0.0000
    2.0000
    can anybody give me solution in c programming
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Reverse order would be 2, 0, 6 would it not? Typically, we don't serve up code. It is in the best interests of the questioner to produce code and ask for help with any problems.

    Asking for help is a fine art when done well; clear information is key. Please be sure and read the "Before you make a query" thread, if you haven't already. Welcome to the forum.
     
  3. friendsforniraj

    friendsforniraj New Member

    Joined:
    Nov 24, 2006
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    studying
    hey use two for loops
    one from i=0 to 2
    this ones take d input
    n another for loop from i=2 to 0
    this ones calculates and print the square root
     

Share This Page