After a while of messing around while trying to get the smallest to largest double to show it finally worked. There is one bug though. The first value always says 0 is the smallest number. Other than that it works like a charm.
The true problem is trying to do this with units of measurement. I just
can't find a way to do this... This is my horrible attempt of trying to piece
it together and show the number a long side it's unit of measurement.
Would anyone be so kind as to show me this in the simplest way possible?
I'm doing this from a book so I have to learn how to do it the hard way before
I move on to my lesson on vectors etc. So if, while, for, else, etc will
be a big help instead of all the other things I don't even understand yet.
Like superdude, I don't know what you're trying to do. If you give us more info or maybe post the example from the book, we'd be able to help more.
Some things I see from looking at your code:
unit, m, cm, in, ft, previous_unit, smallest_unit and largest_unit are of type char, which means they can only hold one character.
Lines 21-41 are not equations as you might think, they are assignments.
This is a problem that a lot of new comers seem to stumble into, as they can get some familiar mathematical concepts confused with programming concepts.
By your logic, the following would be impossible : i = i + 1;
It's not an equation, it's an assignment.