I am creating a simple program to determine the largest and smallest number of a set of numbers entered by the user. So far this is what I have come up with. But upon testing I am getting a errors. Please help me fix my errors.
#include <iostream>
usingnamespace std;
int main()
{
int largest, smallest, num1, num2;
cout << "How many numbers do you want to enter " << endl;
cin >> num1;
for (int i = 1; i < num1; i++) // begining of for loop
{
cout << "Enter a number " << endl;
cin >> num2;
if (num2 > num1)
{
largest = num2;
cout << "Enter a number " << endl;
}
if (num2 < num1);
{
smallest = num2;
cout << "Enter a number " << endl;
cin >> num1;
}
cout << "Your largest number is " << largest << endl;
cout << "Your smallest number is " << smallest << endl;
}
return 0;
}