Write a program, using nested loops, to display the following:
1
12
123
1234
12345
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 <= 5; i++)
{
for (int j = 1; j <= i; j++)
{
Console.Write(j.ToString());
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
Comments
Leave a comment