Properly use Return Keyword
<p>I'm fairly new to programming and I have a question. I want to get a list of computers on the network, I have done this successfully, then I have been able to get how many computers there are by using .Count()...The issue is, I have several places in my full code where I would like to reference that number, and everytime I try to use c, it tells me that variable doesn't exist in its context. I tried to make my own public method but then it asks me to put in a proper return, and after searching. I still can't figure it out.. Can anyone point me in the correct direction? Thank you. </p>

<pre><code>public void ComputersOnNetwork()
{
   List&lt;string&gt; list = new List&lt;string&gt;();
   using (DirectoryEntry root = new DirectoryEntry("WinNT:"))
   {
       foreach (DirectoryEntry computer in computers.Children)
       {
           if ((computer.Name != "Schema"))
           {
               list.Add(computer.Name);
           }
       }

       foreach (string s in list)
       {
          int c = list.Count();
          return c;
       }       
</code></pre>
