using System;
class abc
{
int n;
public void fun()
{
Console.WriteLine("enter the number of rows : ");
n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("pattern is : ");
for (int i = 0; i <= n; i++)
{
for (int j = 0; j <= n; j++)
{
if (i < j)
Console.Write("*");
else
Console.Write(" ");
}
Console.Write("\n");
}
Console.ReadKey();
}
}
class pat8
{
public static void Main(string[] args)
{
abc a = new abc();
a.fun();
}
}
class abc
{
int n;
public void fun()
{
Console.WriteLine("enter the number of rows : ");
n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("pattern is : ");
for (int i = 0; i <= n; i++)
{
for (int j = 0; j <= n; j++)
{
if (i < j)
Console.Write("*");
else
Console.Write(" ");
}
Console.Write("\n");
}
Console.ReadKey();
}
}
class pat8
{
public static void Main(string[] args)
{
abc a = new abc();
a.fun();
}
}
Output:
No comments :
Post a Comment