I'm just learning C# and I need to compare these 2 arrays and display which ones do not match according to the user's input of A,B,C,D. Can someone please help me out?
Here's what I have so far.
static void Main()
{
char[] exArray = new char[20] { 'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A' };
char[] usArray = new char[20];
Console.WriteLine("Please enter your answers for each exam question.");
for (int a = 0; a < 20; a++)
{
Console.Write("Question #{0}: ", (a + 1));
usArray[a] = Convert.ToChar(Console.ReadLine());
}
do I use another for loop to compare the 2 or do i use a method and call both arrays in?
How do I compare these 2 arrays?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Roei BarRank #1,271 · 1.4K reputationPosted Sep 7, 2009, 12:58 PM EDT
here is your code with the missing part
static void Main() { char[] exArray = new char[20] { 'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A' }; char[] usArray = new char[20]; Console.WriteLine("Please enter your answers for each exam question."); for (int a = 0; a for (int i = 0; i } } }