I need help with this assignment, I dont know where to start. Here is what the assignment is:
Write a program that finds both the largest and smallest of several integers. Assume that the first integer read specifies the number of values remaining to be entered and that the first number is not one of the integers to compare. Your program should read only one value per input statement. For example, an input sequence might be
6 20 30 40 50 60 70
where the 6 indicates that the subsequent 6 values are to be compared.
Can someone please help? This is all i have come up with:
//Assign2: assign2_00.cpp
// project finds the largest and smallest numbers of 6 integers
#include <iostream>
using namespace std;
int main()
{
int counter = 1;
int number;
while (counter<=6)
{
cout<<"Enter number: "<<endl;
counter++;
cin>>number;
}
{
if (number>=70)
cout<<"largest number is: "<<number<<endl;
if (number <=20)
cout<<"smallest number is: "<<number<<endl;
}
}