I'm trying to write a program that uses vector to store the grades for the number of students entered.But i seem to be getting some problems with my code.
I am able to enter the number of students, but when it asks for the grades, the program exits.
I hope someone can tellme whats wrong with my code
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> Grades;
int i= 0;
cout << "Enter number of students: ";
cin >> i;
for( i = 0; i < 0; i++)
{
cout << "Enter grade for student" << (i + 1) << ": ";
cin >> Grades[i];
}
int Total = 0;
for(int i = 0; i < 0; i++)
{
// Add to the total
Total += Grades[i];
}
double Average = (double)Total / i;
cout << "Average Mark: " << Average << "\r\n";
system("PAUSE");
return 0;
}