On line 50 I am getting an error that reads "error: 'cout' does not name a type. When I Google this issue I see multiple people saying to include the namespace std; which I have. Any other suggestions as to why I am getting this error?
#include <iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
void getUserInput(int &num);
void whileNum(int &num, int &smallest, int &largest);
//initiate main
int main()
{//open main()
//establish integers
int num=0;
int smallest, largest;
getUserInput(num);
whileNum(num, smallest, largest);
system("Pause");
return 0;
}//close main()
//initiate called module getUserInput
void getUserInput(int &num)
{ //open getUserInput()
cout << "Enter a number of -99 to QUIT" << endl;
cin>> num;
} //close getUserInput()
void whileNum(int &num, int &smallest, int &largest)
{
while (num != -99);
{//open while()
largest=num;
smallest=num;
//if statements for maximum and minimum
if (num>largest)
largest=num;
if (num<smallest)
smallest=num;
}
} //close while()
//display largest and smallest values
cout << "Largest: " << largest << " Smallest: " << smallest << endl;