Enter the number : 5
class Program
{
static void Main(string[] args)
{
int i=0;
Console.WriteLine("Enter the number");
int n = int.Parse(Console.ReadLine());
char[] ch = { 'a', 'e', 'i', 'o', 'u' };
for(int row=0;row<=n;row++)
{
for(int space=n;space>row;space--)
{
Console.Write(" ");
}
for(int coll=1;coll<=row*2-1;coll++)
{
Console.Write(ch[i]);
i++;
if (i > 4)
i = 0;
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
a
e i o
u a e i o
u a e i o u a
e i o u a e i o u
class Program
{
static void Main(string[] args)
{
int i=0;
Console.WriteLine("Enter the number");
int n = int.Parse(Console.ReadLine());
char[] ch = { 'a', 'e', 'i', 'o', 'u' };
for(int row=0;row<=n;row++)
{
for(int space=n;space>row;space--)
{
Console.Write(" ");
}
for(int coll=1;coll<=row*2-1;coll++)
{
Console.Write(ch[i]);
i++;
if (i > 4)
i = 0;
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
No comments:
Post a Comment