Program to print *

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = 1;
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < num; j++)
                {
                    Console.Write("*");
                }
                num++;
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}

Output:
*
**
***
****
*****

Author:

Since March 2011, have 8+ years of professional experience on software development, currently working as Senior Software Engineer at s3 Innovate Pte Ltd.

Leave a Reply