using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LeftPattern
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the maximum of * :");
int n = Convert.ToInt32(Console.ReadLine());
for (int i = n; i >= 1; i--)
{
for (int j = 0; j <n- i; j++)
Console.Write(" ");
for (int j = 1; j <= i; j++)
Console.Write("*");
Console.WriteLine();
}
Console.WriteLine();
Console.ReadLine();
}
}
}
Output:
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LeftPattern
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the maximum of * :");
int n = Convert.ToInt32(Console.ReadLine());
for (int i = n; i >= 1; i--)
{
for (int j = 0; j <n- i; j++)
Console.Write(" ");
for (int j = 1; j <= i; j++)
Console.Write("*");
Console.WriteLine();
}
Console.WriteLine();
Console.ReadLine();
}
}
}
Output:
No comments:
Post a Comment