Write a program, using nested loops, to display the following:
7 6 5 4 3 2 1
7 6 5 4 3 2
7 6 5 4 3
7 6 5 4
7 6 5
7 6
7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using BankAccountLibrary;
namespace Q212610
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 7; i++)
{
for (int j = 7; j >= i; j--)
{
Console.Write(j.ToString()+" ");
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
Comments
Leave a comment