I am trying to write a program that allows the user to input positive integers between 0 and 1000 and then outputs the highest value and the lowest value. The user should enter -1 to signify the end of their input. I am supposed to use a loop to achieve this.
I am not allowed to use arrays and I am not sure which loop to use. Here is what I have so far:
#include <iostream>
using namespace std;
int main ()
{
int first_input, largest, smallest
cout << "Enter numbers between 0 and 1000 and i will tell you the highest and"<<endl;
cout << " lowest numbers. Enter -1 to signal the end of your data entered." << endl;
cin >> first_input
if (first_input > 1000)
{
cout << "Please enter a positve number lower than 1000." << endl;
cin >> first_input
}