C# Sum of first 50 Natural Numbers using For Loop

The natural numbers are those used for counting (as in “there are six coins on the table”) and ordering (as in “this is the third largest city in the country”). In common mathematical terminology, words colloquially used for counting are “cardinal numbers” and words connected to ordering represent “ordinal numbers”. (wiki)

 

using System;

class Program
{
    public static void Main()
    {
        int num, sum = 0;

        for (num = 1; num <= 50; num++)
        {
            sum = sum + num;
            Console.WriteLine("#{0} Sum = {1}", num, sum);
        }

        Console.WriteLine("Total Sum = {0}", sum);

        Console.ReadLine();
    }
}

 

Output