/* Program to process exam grades */ #include #include 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\\cis1_5\\newpgms\\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"); return 0; }