Having trouble with recursive methods in c#
<p>Having trouble with recursive methods in c#. When compiled it should just display the total sumUpToo of all number for the given int, i.e
- input 10
- output 55 (10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0)</p>

<p>Im not able to find any info anywhere so if someone has a link to a website that can teach me how to go through it, would be greatly appreciated.</p>

<pre><code>class Program
{
    static void Main(string[] args)
    {
        public static int sum(int x)
        {
        Console.WriteLine("num");
        x = Console.ReadLine();
        int sum = 0, i = 0;
        for (i = 0; i &lt;= x; i++)

        {
            sum = sum + i;
        }
        Console.WriteLine("{0}", sum);
        }
        public static int recursivesum(int x)
        {
        if (x &lt;= 1)
            Console.WriteLine("{0}", x);
        else
           (x + Recursivesum(x - 1));
        }
</code></pre>

<p>edit * This is the adjustment seems to be working fine now, if im not mistaken. Thanks for all the help</p>

<pre><code>class Program
{
    static void Main(string[] args)
    {
        int x;
        Console.Write("Please enter an integer value to sum up to: ");
        x = Convert.ToInt32(Console.ReadLine());

        Console.WriteLine("The sum of all numbers up to and including {0} is {1}",x, recursivesum(x));
    }

    public static int sum(int x)
    {
        int sum = 0, i = 0;
        for (i = 0; i &lt;= x; i++)
        {
        sum = sum + i;
        }
        return sum;
    }

    public static int recursivesum(int x)
    {
        if (x &lt;= 1)
            return x;    
        else
            return x + recursivesum(x-1);

    }
}
</code></pre>

<p>}</p>
