The book I'm reading says to make a program that shows the difference between the largest and smallest elements of an array. It sounded easy and I thought I'd be able to do it, but man, I've been trying for awhile and I can't think of any possible way to do this. Is there something obvious here that I'm missing? I've been using a loop to go through the array and another loop to go through at the same time for comparison, but this brings up lots of problems.
Can someone give me sample code and explain how to do this? It would help greatly!