I can't seem to get this code to work 100%, the smaller number keeps coming up as a -8******* number, everything else seems to be in order.
Code://This program will display the largest and smallest numbers entered. #include <iostream> using namespace std; int main() { int num; int LargeNum; int SmallNum; cout << "Enter an integer: "; cin >> num; while (num != -99) { cout << "Enter another integer or enter -99 to stop." << endl; cin >> num; if (num > LargeNum) LargeNum = num; if (num < SmallNum && num !=-99) SmallNum=num; } cout << "The largest number entered was: " << LargeNum << endl; cout << "The smallest number entered was: " << SmallNum << endl; return 0; }