Do you know anything about data structures, because this sounds like homework to me. Anyway I'm not giving you code because of the last statement but I will help you understand what you have to do. You're going to want to put all the numbers in vector, then you are going to want to put the first number of that vector in an integer and compare it to the next value that is in the stack, I would use a for loop. I'll give you code right now because it's hard to describe
int compareValue;
int lowestint;
int highestint;
//inside your while loop
for(int i = 1; i < stack.size();i++)//stack is whatever you put your entered values in
{
compareValue = stack[0];
if(compareValue < stack[i])
{
lowestint = compareValue;
}
else
{
lowestint = stack[i];
}
if(compareValue > stack[i])
{
highestint = compareValue;
}
else
{
highestint = stack[i];
}
} This is a start, I know I said I wouldn't give you code but it just seems easier to give this part to you and make you figure it out. I may be wrong too but that sounds like the pseudocode you should use when writing the program.
At the end of the program you are going to want to have these two lines to show your highest and lowest values shown:
cout << "Highest value is:" << highestint << endl;
cout << "Lowest value is:" << lowestint << endl;