Can't get array to input correctly

Hi, I am trying to get 5 quiz scores, 3 exam scores, and 1 final exam score in this bit of code. However, when I run this and print it out, the last quiz value is 0 and then the first exam value is the last quiz value. I have no clue what is wrong with my code. Any help would be greatly appreciated :)

void get_scores()
{
cout << "Please enter your final exam score." << endl;

{
cin >> fexam;
}
cout << " Please enter your quiz scores."<<endl;
for (int i = 0; i < 4; ++i)

{
cin >> quiz[i];
}

cout << "Please enter your exam scores." << endl;
for (int i = 0; i < 2; ++i)
{
cin >> exams[i];
}

}


This is how they are declared:
int exams [3] ; //amount of exams
int quiz [5] ; //amount of quizzes
int fexam; //amount of finals exams
Please don't double post, it's ultimately a time waster for those who reply. Please delete the other post.

Also, please use code tags: http://www.cplusplus.com/articles/z13hAqkS/

You need to declare your variables before you use them, don't have global variables.

You are 1 short with for loops:
1
2
// loop 5 times
for (int i = 0; i < 5; ++i)

Topic archived. No new replies allowed.