I posted a question last night, but I was unable to include my code. The question is again how to determine the highest and lowest value in an array.


//This program will allow the user to input rainfall amounts for twelve months,
//It will then calculate the total amount, the average amount, and tell the months
//with the highest and lowest amounts.

#include <iostream.h>

void main(void)
{
float rain[12];

cout<<"Enter the rainfall (in inches) for each month "<<endl;

for (int count=1; count<=12; count++)
{
cout<<"Month "<<count<<":";
cin>>rain[count-1];
}

cout.precision(2);
cout.setf(ios::fixed|ios::showpoint);

float total = rain[0]+rain[1]+rain[2]+rain[3]+rain[4]+rain[5]+rain[6]+rain[7]+rain[8]+rain[9]+rain[10]+rain[11];
cout<<"The total rainfall was: "<<total<<endl;

float average = total/12;
cout<<"The average rainfall was: "<< average <<" inches. "<<endl;



}

Any other pointers concerning my code would be greatly appreciated, because this is due Monday, and I'm stuck!!

thanks, George