OUTPUT "Enter the rain fall in
inches for each";
DECLARE sum = 0, n = 0;
months= { "January", "February",
"March", "April", "May", "June", "July", "August",
"September",
"October", "November", "December" };
double arr[12];
LOOP I 1 TO 12:
OUTPUT "Enter
the rain fall for month ", months[i]:
READ
arr[i]
sum +=
arr[i];
LOOP END
// finding the min
int min = 0;
LOOP I 1 TO 12:
IF (arr[min]
> arr[i])
min = i;
int max = 0;
//finding the max
LOP I 1 TO 12:
IF (arr[max] < arr[i])
max = i;
OUTPUT: "Total rainfall for the year is ", sum
OUTPUT: "Average rainfall for the
year is " , (sum / 12)
OUTPUT: "The Largest amount of the
rainfaill in year is " , arr[max] , " inches in " ,
months[max]
OUTPUT: "The smallest amount of the
rainfaill in year is " , arr[min] , " inches in " , months[min]
Get Answers For Free
Most questions answered within 1 hours.