title: Searching for a number in an array: c#
body: <p>I need this program to search for the value someone puts into the search but I am unable to get it to do that. I as well can't get the position of the value that I am looking for. I've tried to used myarray.indexof and a few other ways I knew of how to search for the value and display the position as well but I haven't had any success with finding a way to get it to work.</p>
  
  <p>This is what I last attempted.</p>
  
  <pre><code>int[] myArray = new int[10];
  Random randnum = new Random();
          for (int index = 0; index &lt; myArray1.Length; index++)
          {
              myArray1[index] = randnum.Next(0, 99);
              Console.Write("{0}, ",myArray1[index]);
          }
  Console.WriteLine("Enter the value you are looking for in myArray");
  int iSearch = int.Parse(Console.ReadLine());
  int index1 = myArray.IndexOf(iSearch);
  Console.WriteLine(iSearch);
  </code></pre>
  
  <p>Essentially what I need it to do is search for someone to be able to enter a value they are searching for in the random'd array. Then it needs to search for what they are looking for in that array (I don't fully understand the use of my array.IndexOf), and then display to the user what the value they searched for is and what position it is at in the array.</p>