how can i get the largest and smallest value that i input if i input 10 integers?

thank you...new in programming

Printable View

- 03-01-2010bbstar06Question about one dimensional array
how can i get the largest and smallest value that i input if i input 10 integers?

thank you...new in programming - 03-01-2010rags_to_riches
If you had a deck of cards that you could only go through one by one, a piece of paper, and a pencil, how would you do the same task?

- 03-01-2010nadroj
As recommended, what would

*you*do? If someone asks you: how much money would you want from this list: $1, $0, $100, $50, $1000, $42, how do you determine your answer? Do you just look at the first one? Just the last one? Just the, say, middle one? Do you look at all of them?

For any general list (or array), there*is only one*solution. KISS. - 03-01-2010MK27
- 03-01-2010nadroj
What part? Having a single,

*unique*solution to*all*general*programming tasks*? Or the "KISS" principle? I just mentioned "KISS" to him/her because I imagine he/she is just starting out with this sort of thing, and we often tend to overthink or overcomplicate things when starting to learn them. It was my way of saying "dont think too hard about this problem, as you will see when you get it it is a simple solution." - 03-01-2010MK27
The KISS principle.

I guess that implies there often really is one "best" solution (the simplest one). I just think it's a great principle that's worth keeping in mind esp. when programming. Of course, what simple means is ambiguous -- maybe a combination of efficiency and productivity. "Productivity" takes into account that what is simple to one person can be impossible to another. Since you are unlikely to forget who you are, that makes KISS pretty simple to apply most of the time.