This is what I have so far, but I keep getting weird values for my min/max and avg.

// Max, Min, Average of Number String // Shawn Cho // March 20, 2009 // ENGR 021 Monday 6:30-9:40 PM // PURPOSE: Find the max, min and average of a number string. /* PSEUDOCODE For This Program: 1. Include preprocessors needed 2. Ask users to input date as dd mm yyyy. 3. Echo out input back to user. 4. Write out if/else statements for converting mm to certain month. 5. If month is greater than 12 or less than 1, error out. 6. Write out if/else statements for converting dd to days. 7. Write more if/else statements for "st, nd, rd, th". 8. Echo out the output to the user in correct format. */ #include <iostream> #include <conio.h> using namespace std; float n; float x; float q; float min; float max; float avg; int count = 1; int main () { float n; float x; float q; float min; float max; float avg; int count = 1; cout << "Please enter numbers one at a time, pressing return after each one." << endl; cout << "When you want to stop, just enter 0 (a zero). "; cin >>x; n = x; while (x != 0 && count < 100) { cin >>x; if (x == 0) break; if (x > q) x = max; if (x < q) x = min; q = x; n = n + x; count++; } avg = n/count; cout << "Thank you." << endl; cout << "You entered " << count << " numbers."; cout << "The largest number is " << max << endl; cout << "The smallest is " << min << "."<< endl; cout << "The average is " << avg << "." << endl; getch (); return 0; }

Can somebody please help me?

thanks!