C++ help


#1

need help finding errors in someones code for a grade.

// This program averages a set of numbers.
#include <iostream>
using namespace std;

int main()
{
    int numCount, total;
    double average;
    
    cout << "How many numbers do you want to average? ";
    cin >> numCount;
    
    for (int count = 0; count < numCount; count++)
    {
        int num;
        cout << "Enter a number: ";
        cin >> num;
        total += num;
        count++;
    }
        average = total / numCount;
        cout << "The average is " << average << endl;

        system("pause");
        return 0;
}

#2

Hi @xx0062425,

You shouldn't need help finding errors in the code if you're in a position to grade it, and if you're a student trying to get help, you definitely shouldn't be doing it in this way.