/* Program to process exam grades */ #include #include #include //needed to use exit() function using namespace std; int main() { int num,sum=0; int mark; double avgmark; //un-comment to redirect cin to a file //ifstream cin("c:\\bc\\CISC1110\\pgms\\chapter7\\myinput.txt"); cout << "Enter the number of marks: "; cin >> num; if (num > 0) cout << "There are " << num << " marks" <> mark; sum += mark; } avgmark = (double)sum/num; cout << endl << "The average is " << avgmark << endl; // system("pause"); //un-comment when using DevC++ return 0; }