Trying to compare 2 arrays but not getting it to work
Console.WriteLine("Entering elements for ths 1st array: ");
int[] arr1 = new int[3];
for (int i = 0; i < arr1.Length; i++)
{
arr1[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine("Entering the elements for the 2nd array: ");
int[] arr2 = new int[3];
for (int i = 0; i < arr2.Length; i++)
{
arr2[i] = Convert.ToInt32(Console.ReadLine());
}
bool result = Array.Equals(arr1,arr2);
if (result)
{
Console.WriteLine("Equal");
}
else
{
Console.WriteLine("Not equal");
}
}
I keep on getting a Not equal