hi, i need help with how to find the max number and min number from an array. there are 31 numbers, i know that i am suppose to use a for loop to do this and this is what i got so far
array is inputed by user
#include <iostream.h>
int main ()
{
int temp[31];
for(int i=0;i<31;i++)
{
cout<<"ENTER THE TEMPERATURE FOR THE MONTH OF DECEMBER"<<endl;
cin>>temp[i];
}
for(i=0;i<31;i++)
{
if(temp[i]>temp[i+1])
this is where im stuck, i don't know what to do next. i need to find the max and min so now i just need to find a way to swap the order of the array so later on i can just cout the first and last element of the array to show the max and min.