Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. using System;
  2.  
  3. using System.Collections.Generic;
  4.  
  5. using System.Linq;
  6.  
  7. using System.Text;
  8.  
  9. using System.Threading.Tasks;
  10.  
  11.  
  12.  
  13. namespace array
  14.  
  15. {
  16.  
  17. class array
  18.  
  19. {
  20.  
  21. static void Main(string[] args)
  22.  
  23. { Console.WriteLine("enter the length of the first array");
  24.  
  25. byte n = byte.Parse(Console.ReadLine());
  26.  
  27. byte []array=new byte[n];
  28.  
  29.  
  30.  
  31. Console.WriteLine("enter index");
  32.  
  33. for (byte i = 0; i < n; i++)
  34.  
  35. {
  36.  
  37. // Console.WriteLine("enter index[{0}]",i);
  38.  
  39. array[i]= byte.Parse(Console.ReadLine());
  40.  
  41. }
  42.  
  43.  
  44.  
  45. Console.WriteLine("enter the length of the second array");
  46.  
  47. byte n2 = byte.Parse(Console.ReadLine());
  48.  
  49. byte[] array2 = new byte[n2];
  50.  
  51.  
  52.  
  53. Console.WriteLine("enter index");
  54.  
  55. for (byte m = 0; m < n2; m++)
  56.  
  57. {
  58.  
  59. // Console.WriteLine("enter index[{0}]", m);
  60.  
  61. array[m] = byte.Parse(Console.ReadLine());
  62.  
  63. }
  64.  
  65.  
  66.  
  67. bool equalArrays = false;
  68.  
  69.  
  70.  
  71. if (n == n2) {
  72.  
  73. for (sbyte index = 0; index < n; index++)
  74.  
  75. {
  76.  
  77. if (array[index]==array2[index]){
  78.  
  79. equalArrays = true;
  80.  
  81. Console.WriteLine(equalArrays);
  82.  
  83. }
  84.  
  85. }
  86.  
  87. }
  88.  
  89. else
  90.  
  91. Console.WriteLine("The arraies are ot equal!");
  92.  
  93. }
  94.  
  95. }
  96.  
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement