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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Srinivas Rao53 reputationPosted Oct 14, 2015, 6:41 AM EDT
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();
}
}
}