title: Trying to turn Normal code into a method/ function
body: <pre><code> class Program
    {
        static void Main(string[] args)
        {
            int[] search = { 88, 62, 5, 18, 22, 78, 13, 8, 33, 7 };
            Console.WriteLine(&quot;Enter value to find&quot;);
            int val = int.Parse(Console.ReadLine());
  
            int place = -1;
            for (int i = 0; i&lt;10; i++)
            {
                
                if (search[i]== val)
                {
                    place = i +1;
                }
               
  
            }
            if(place == -1)
            {
                Console.WriteLine(&quot;The Target Value was not found in the list&quot;);
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine(&quot;The Target Value was found at location: &quot; + place);
                Console.ReadLine();
            }
        }
    }
  }
  </code></pre>
  <p>I'm trying to search for an entered value in an array, and I got that working, now I want to make it a method/ function but I have no idea how.</p>