Hi friend,
I want to display below format , please help code
suppose , given input number is 4
4 3 2 1
3 2 1
2 1
1
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Srinivas RaoPosted Oct 14, 2015, 10:41 AM
namespace loop
{
class Program
{
static void Main(string[] args)
{
int n, i, dn;
Console.WriteLine("Enter a value:");
n=int.Parse(Console.ReadLine());
i = n;
while(i>=1)
{
Console.Write("\n");
dn = i;
while(dn>=1)
{
Console.Write( dn);
dn = dn - 1;
}
i = i - 1;
}
Console.ReadKey();
}
}
}