title: Printing the amount of all numbers between 1 and the number. No errors and it doesnt work
body: <p>trying ti create a program that will observe a number and calculate the amount of all the numbers between 1 and the number that has been observed.
  I've been asked to use a function to do so. No errors are showing up when i run the program, it observes the number and does nothing after that. There's the code:</p>
  
  <pre><code>using System;
       using System.Collections.Generic;
       using System.Linq;
       using System.Text;
       using System.Threading.Tasks;
   namespace ConsoleApplication2
   {
       class Program
       {
           static void Main(string[] args)
           {
              int i;
              int n=0;
              int a=0;
              Console.WriteLine("Enter a number: ");
              i = (Convert.ToInt32(Console.ReadLine()));
              AmountOfNumbers(ref i,ref n,ref a);
              Console.Write(a);
          }
           static void AmountOfNumbers (ref int i,ref int n,ref int a)
              {
              while (n &lt; i)
              {
                  a += n;
              }
              }
      }
  
  }
  </code></pre>
  
  <p>Any help would be appreciated, thanks ahead. </p>