Homework problem with Arrays

My program isn't working the way I want it to obviously. But one very strange thing that I cannot figure out one bit is when I answer with all B, the final score is 2.
Answering with all A, C or D makes the score 1.

But aside from that can I get a tip on why my program isnt working right? I'm very new to arrays but I think I'm starting to understand it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
using namespace std;

//Brandon Skar. 11/13/2016. Driver's License Exam
int main()
{
	int row = 0, col = 0, score = 0;
	char examScore[5][4];
	char examAnswers[5][4] = { {'A', 'B', 'A', 'C'},
							   {'D', 'A', 'C', 'C'},
							   {'B', 'B', 'D', 'A'},
							   {'B', 'C', 'B', 'D'},
							   {'C', 'D', 'D', 'B'} };
	cout << "Enter answers A, B, C, D (case sensitive)" << endl;
	for (int count = 0; count < 20;)
	{
		while (col < 4)
		{
			while (row < 5)
			{
				cout << "Answer for Question " << (count + 1) << ": ";
				cin >> examScore[row][col];
				if (examScore[row][col] != 'A' && examScore[row][col] != 'B' && examScore[row][col] != 'C' && examScore[row][col] != 'D')
				{
					cout << "Invalid Input, Please Try Again.\n" << endl;
					system("pause");
					return 0;
				}
				row++;
				count++;
			}
			col++;
			row = 0;
		}
	}
		row = 0, col = 0;
		while (col < 4)
		{
			while (row < 5)
			{
				if (examScore[row][col] == examAnswers[row][col])
				{
					score += 1;
				}
				row++;
			}
			col++;
		}

	cout << score << endl;

	system("pause");
	return 0;
}
You should loop row first and the inner while loop is column (col).
Ok, I switched it all up but the program still isn't working right. If I type all A's as my answer the final score should be 4 but it's coming out as 2.
Did I mess up my declarations or anything?
Topic archived. No new replies allowed.