I have a program in which tells me the highest number and the lowest number. ( i am using a loop for the highest and lowest)
I need to get the second highest and second lowest. without an array
i was wondering if i could find that within the same loop?
i already have the code for the largest and smallest
it just wont let me get the second largest and second smallest.
The user enters 30 numbers, find the second largest and second smallest
for(int i =0; i<30 ; i++) if(input>maxi) maxi=input; if (input <mini) mini=input; //finds max and min