Java/PHP/GitLab Fan, Passionate Developer and Loves Teaching

0%

Pattern Printing 3

Summary

The following pattern is in C#, as it was asked by one of my friend.

Prints the pattern in the following way

1
2
3
4
5
12345
2345
345
45
5

Screenshot

Pattern Printing Output

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;

namespace TestApplication
{
class Pattern
{
public static void Main()
{
for (int i = 1; i <= 5; i++)
{
for (int j = i; j <= 5; j++)
{
Console.Write(j);
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}