Thread: Getting numbers in order

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    4

    Getting numbers in order

    How I get numbers to print out in increasing order from an equation that calculates distances with more than 1 answer?

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Store them somewhere first (for example, in an array). Then sort them before printing.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by SimpleSun29 View Post
    How I get numbers to print out in increasing order from an equation that calculates distances with more than 1 answer?
    That's a pretty good question. You should think about that. Then break it down into steps, in actual words. Don't try to program it. Describe the problem as best you can in words, in a series of steps to get it done. When you can do that, then think about turning each step into code.


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. three numbers in descending order
    By jackson6612 in forum C++ Programming
    Replies: 3
    Last Post: 05-21-2011, 08:05 AM
  2. Replies: 9
    Last Post: 04-01-2011, 04:13 PM
  3. Putting numbers in order
    By Queatrix in forum C++ Programming
    Replies: 7
    Last Post: 05-01-2005, 01:00 PM
  4. Help with listing numbers in order
    By boontune in forum C++ Programming
    Replies: 2
    Last Post: 03-23-2003, 07:56 PM
  5. display numbers in order
    By mike in forum C++ Programming
    Replies: 2
    Last Post: 09-24-2001, 09:16 PM