Pattern Printing 3

3/21/2012 code-examplecsharppattern-printing

# Summary

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

Prints the pattern in the following way

12345
2345
345
45
5
1
2
3
4
5

# Screenshot

Pattern Printing Output

# Code

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();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20