// con1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include using namespace std; int main() { // Version 2: ask the user to enter the num students first int i = 0, sum = 0, count = 0, inputNum = 100; double average; cout << "Enter the number of students:"; cin >> count; i = 0; while (i < count) { cout << "enter the next grade:"; cin >> inputNum; sum += inputNum; i++; } average = (double)sum / count; cout << "The average of the " << count << " numbers that you entered is:" << average << endl; return 0; }