title: Find Value in Array Comparing To Index
body: <p>I am learning C# on my own and came across a question where i got stuck.
  I need to find value of array based on input from user.</p>
  
  <pre><code>string[] arr = new string[6];
              arr[0] = "Us";
              arr[1] = "Canada";
              arr[2] = "Uk";
              arr[3] = "China";
              arr[4] = "India";
              arr[5] = "Korea";
  
  Console.WriteLine("Choose a Country (or -1 to quit):");
  </code></pre>
  
  <p>Now if user enter's 3 it will select China.</p>
  
  <p>I am confused how to <strong>compare user input with index and get that value</strong>.</p>
  
  <p>I tried, but does not seem to work :(</p>
  
  <pre><code>int number = Convert.ToInt32(Console.ReadLine());
  int arrayindex = Array.IndexOf(arr,number);
  </code></pre>