Recent Posts
recent

WRITE A PROGRAM TO ARRANGE NUMBERS IN ORDER

Write a Program to arrange numbers in below order

5
4 5
3 4 5
2 3 4 5
1 2 3 4 5

class Program
{
static void Main(string[] args)
{
int i, j, k=5;
for (i = 1; i <= 5; i++)
{
k = k - i;
for (j = 1; j <=i; j++)
{
k = k + 1;
Console.Write(k+" ");
}

Console.WriteLine();
}
Console.ReadLine();
}
}
Unknown

Unknown

No comments:

Post a Comment

Powered by Blogger.