May 3, 2020

How to print star pattern in c#

How to print star pattern in c#.

In this article, we will learn how to print star below pattern in c#

How to print star pattern in c#

Sample Solution

C# Sharp Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

    }
}

                                                                    Sample Output

How to print star pattern in c#



1 comment: