Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Exercise02
- {
- static void Main(string[] args)
- {
- Console.WriteLine("The lenght of the arrays is:");
- int n = int.Parse(Console.ReadLine());
- int[] arrayOne = new int[n];
- int[] arrayTwo = new int[n];
- Console.WriteLine("Elements of a first array:");
- for (int i = 0; i < n; i++)
- {
- arrayOne[i] = int.Parse(Console.ReadLine());
- }
- Console.WriteLine("Elements of a second array:");
- for (int i = 0; i < n; i++)
- {
- arrayTwo[i] = int.Parse(Console.ReadLine());
- }
- for (int i = 0; i < n; i++)
- {
- if (arrayOne[i] == arrayTwo[i])
- {
- Console.WriteLine("The elements arrayOne[{0}] and arrayOne[{0}] are equal", i);
- }
- else
- {
- Console.WriteLine("The elements arrayOne[{0}] and arrayOne[{0}] are NOT equal", i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment