Enter the number:5
1
a e i
2 3 4 5 6
o u a e i o u
7 8 9 10 11 12 13 14 15
1
a e i
2 3 4 5 6
o u a e i o u
7 8 9 10 11 12 13 14 15
class Program
{
static void Main(string[] args)
{
int ro, cl, i = 0, no, A = 1;
string[] arr = new string[] { "a", "e", "i", "o", "u" };
Console.WriteLine("Enter a value : ");
no = int.Parse(Console.ReadLine());
for (ro = 1; ro <= no; ro++)
{
for (cl = no; cl > ro; cl--)
{
Console.Write(" ");
}
for (cl = 1; cl <= (ro * 2 - 1); cl++)
{
if (ro % 2 != 0)
{
Console.Write(" " + A);
A++;
}
else
{
Console.Write(" " + arr[i]);
i++;
if (i > 4)
i = 0;
}
}
Console.WriteLine("");
}
Console.ReadLine();
}
}
No comments:
Post a Comment