Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class CompareTwoArrays
- {
- static void Main()
- {
- Console.Write("Enter the size of the arrays: ");
- int size = int.Parse(Console.ReadLine());
- int[] first = new int[size];
- for (int i = 0; i < size; i++)
- {
- Console.Write("Enter value for intex [{0}] of the first array: ", i);
- first[i] = int.Parse(Console.ReadLine());
- }
- Console.WriteLine();
- int[] second = new int[size];
- for (int j = 0; j < size; j++)
- {
- Console.Write("Enter value for index [{0}] of the second array: ", j);
- second[j] = int.Parse(Console.ReadLine());
- }
- for (int index = 0; index < size; index++)
- {
- Console.Write(first[index] + " ");
- if (first[index] > second[index])
- {
- Console.Write("> ");
- }
- else if (first[index] < second[index])
- {
- Console.Write("< ");
- }
- else
- {
- Console.Write("= ");
- }
- Console.WriteLine(second[index]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement