Pattern printing program

In this blog, we are going to code different patterns that usually asked. Many of us get confused between loops and conditions. And it is also one of the most asked interview questions.
 
Pattern printing program

In the table given below, we have listed out various patterns.

Note: If you are new to C# and Console Application. Try to code First C# Program

Note: Read articles on how to use Loops and Conditions.

Let’s find out a simple and easy way to code these pattern.

S.no.
Pattern
1.     

@@@@@
@@@@@
@@@@@
@@@@@
@@@@@

Click to view pattern code

2.     

1
1 2
1 2 3
1 2 3 4

Click to view pattern code

3.     

# # # # #
# # # #
# # #
# #
#

Click to view pattern code

4.     

*
**
***
****
*****

Click to view pattern code

5.     

          12345
          12345
          12345
          12345
          12345

Click to view pattern code

6.     

          54321
          54321
          54321
          54321
          54321

Click to view pattern code

7.     

          55555
          44444
          33333
          22222
          11111

Click to view pattern code

8.     

11111
22222
33333
44444
55555

Click to view pattern code

9.     

          1
          12
          123
          1234
          12345

Click to view pattern code

10.   

          12345
          1234
          123
          12
          1

Click to view pattern code

11.   

1
1          2
1          2          3
1          2          3          4
1          2          3          4          5

Click to view pattern code

12.   

          5 4 3 2 1
          4 3 2 1
          3 2 1
          2 1
          1

Click to view pattern code

13.   

       1
       2 1
       3 2 1
       4 3 2 1
       5 4 3 2 1

Click to view pattern code

14.   

       12345
       1234
       123
       12
       1

Click to view pattern code

15.   

1      2      3      4      5
1      2      3      4
1      2      3
1      2
1

Click to view pattern code

16.   

1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1

Click to view pattern code

17.   

1 2 3 4 5 4 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1

Click to view pattern code

18.   

*
* * *
* * * * *
* * * * * * *
* * * * * * * * *

Click to view pattern code

19.   

          1
          2 3
          4 5 6
          7 8 9 10

Click to view pattern code

20.   

       A
       B B
       C C C
       D D D D

Click to view pattern code

21.   

          A
        A B A
      A B C B A
    A B C D C B A
  A B C D E D C B A

Click to view pattern code

22.   

A B C D E D C B A
  B C D E D C B
    C D E D C
      D E D
        E

Click to view pattern code

23.   

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1

Click to view pattern code

24.   

L
L I
L I V
L I V E
L I V E V
L I V E V I
L I V E V I A
L I V E V I A R
L I V E V I A
L I V E V I
L I V E V
L I V E
L I V
L I
L

Click to view pattern code

25.   

A
BB
CCC
DDDD
CCC
BB
A

Click to view pattern code

26.   

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Click to view pattern code

27.   

123454321
 2345432
  34543
   454
    5

Click to view pattern code

28.   

    1
   21
  321
 4321
54321

Click to view pattern code

29.   

54321
 4321
  321
   21
    1

Click to view pattern code

30.   

      1
     2 2
    3 3 3
   4 4 4 4
  5 5 5 5 5

Click to view pattern code

31.   

    1
   1 2
  1 2 3
 1 2 3 4
1 2 3 4 5

Click to view pattern code

32.   

     *
    ***
   *****
  *******
 *********
  *******
   *****
    ***
     *

Click to view pattern code

33.   

     1
    212
   32123
  4321234
 543212345
  4321234
   32123
    212
     1

Click to view pattern code

34.   

     1
    121
   12321
  1234321
 123454321
  1234321
   12321
    121
     1

Click to view pattern code

35.   

     A
    ABA
   ABCBA
  ABCDCBA
 ABCDEDCBA
  ABCDCBA
   ABCBA
    ABA
     A

Click to view pattern code

36.   

     A
    ABA
   ABCBA
  ABCDCBA
 ABCDEDCBA

Click to view pattern code

37.   

ABCDEDCBA
 ABCDCBA
  ABCBA
   ABA
    A

Click to view pattern code

38.   

     A
    AB
   ABC
  ABCD
 ABCDE
  ABCD
   ABC
    AB
     A

Click to view pattern code

39.   

A
BA
CBA
DCBA
EDCBA
DCBA
CBA
BA
A

Click to view pattern code

40.   

EDCBA
DCBA
CBA
BA
A

Click to view pattern code

41.   

9
0 1
2 3 4
5 6 7 8
9 0 1 2 3

Click to view pattern code

42.   

1234554321
1234  4321
123    321
12      21
1        1

Click to view pattern code

43.   

1234554321
1234__4321
123____321
12______21
1________1

Click to view pattern code

44.   

A
11
BBB
2222
CCCCC

Click to view pattern code

45.   

    1
   123
  12345
 1234567
123456789

Click to view pattern code

46.   

1234554321
12344321
123321
1221
11

Click to view pattern code

47.   

ABCDEEDCBA
ABCDDCBA
ABCCBA
ABBA
AA

Click to view pattern code

48.   

    1
   222
  33333
 4444444
555555555

Click to view pattern code

49.   

9
898
78987
6789876
567898765

Click to view pattern code

50.   

5
45
345
2345
12345

Click to view pattern code

51.   

5
454
34543
2345432
123454321

Click to view pattern code

52.   

*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********

Click to view pattern code

53.   

4444444
4333334
4322234
4321234
4322234
4333334
4444444

Click to view pattern code

54.   

*
**
* *
*  *
*****

Click to view pattern code

55.   

*
***
******
**********
***************

Click to view pattern code

56.   

**********
****  ****
***    ***
**      **
*        *

Click to view pattern code

57.   

1
3 5 7
9 11 13 15 17 19

Click to view pattern code

58.   

54321
5432
543
54
5

Click to view pattern code

59.   

1
AB
123
ABCD
12345

Click to view pattern code

60.   

    1
   2 3
  4 5 6
 7 8 9 10

Click to view pattern code

61.   

 1 2 3 4 5
  2 3 4 5
   3 4 5
    4 5
     5

Click to view pattern code

62.   

A
BA
ABA
BABA
ABABA

Click to view pattern code

63.   

*
**
***
****
*****
******
*****
****
***
**
*

Click to view pattern code

64.   

1
232
34543
4567654
567898765

Click to view pattern code

65.   

12321
12 21
1   1
12 21
12321

Click to view pattern code

66.   

ABCBA
AB BA
A   A
AB BA
ABCBA

Click to view pattern code

67.   

*********
*******
*****
***
*

Click to view pattern code

68.   

12345
23451
34512
45123
51234

Click to view pattern code

69.   

ABCDE
BCDEA
CDEAB
DEABC
EABCD

Click to view pattern code

70.   

12345
4512
123
45
1

Click to view pattern code

71.   

ABCDE
DEAB
ABC
DE
A

Click to view pattern code

72.   

1
2 3
4 5 6
7 8 9 1
2 3 4 5 6

Click to view pattern code

73.   

1
123
12345
1234567
123456789

Click to view pattern code

74.   

155555
224444
333333
444422
555551

Click to view pattern code

75.   

1     a
21    ba
321   cba
4321  dcba
54321 edcba

Click to view pattern code

76.   

1
01
010
1010
10101

Click to view pattern code

77.   

1
01
101
0101
10101

Click to view pattern code

78.   

*******
*     *
*     *
*     *
*     *
*     *
*******

Click to view pattern code

79.   

*********
*       *
*       *
*       *
*********

Click to view pattern code

80.   

1
*2
1*3
*2*4
1*3*5

Click to view pattern code

81.   

1
A B
2 3 4
C D E F
5 6 7 8 9

Click to view pattern code

82.   

* ***** ***** *
** **** **** **
*** *** *** ***
**** ** ** ****
***** * * *****

Click to view pattern code

83.   

3569
569
69
9

Click to view pattern code

84.   

1
23
4
56
7
89
10

Click to view pattern code

85.   

1
121
1231
12341
123451

Click to view pattern code

86.   

1
121
12321
1234321
123454321

Click to view pattern code

87.   

1
2*2
3*3*3
4*4*4*4
5*5*5*5*5
5*5*5*5*5
4*4*4*4
3*3*3
2*2
1

Click to view pattern code

88.   

*0000
0*000
00*00
000*0
0000*

Click to view pattern code

89.   

8
16 17
32 33 34 35
64 65 66 67 68 69 70 71

Click to view pattern code

90.   

 # # # # # * # # # # #
 # # # # * # * # # # #
 # # # * # # # * # # #
 # # * # # # # # * # #
 # * # # # # # # # * #
 * # # # # # # # # # *

Click to view pattern code

91.   

543212345
 4321234
  32123
   212
    1

Click to view pattern code

92.   

    5
   454
  34543
 2345432
123454321

Click to view pattern code

93.   

9
8 6
7 5 3
4 2 0 -2
1 -1 -3 -5 -7

Click to view pattern code

94.   

*0000*0000*
0*000*000*0
00*00*00*00
000*0*0*000
0000***0000

Click to view pattern code

95.   

1
2 7
3 8 13
4 9 14 19
5 10 15 20 25

Click to view pattern code

96.   

A
1
BB
22
CCC
333

Click to view pattern code

97.   

@
#
@@
##
@@@
###

Click to view pattern code

98.   

1
1 4 9
1 4 9 16 25
1 4 9 16 25 36 49
1 4 9 16 25 36 49 64 81

Click to view pattern code

99.   

-----1
----212
---32123
--4321234
-543212345
--4321234
---32123
----212
-----1

Click to view pattern code

100.                

ABCDEDCBA
ABCD DCBA
ABC CBA
AB BA
A A
AB BA
ABC CBA
ABCD DCBA
ABCDEDCBA

Click to view pattern code

101.                

543212345
 5432345
  54345
   545
    5

Click to view pattern code

102.                

123454321
1234_4321
123___321
12_____21
1_______1

Click to view pattern code

103.                

A
BA
ABA
BABA
ABABA

Click to view pattern code

104.                

A
aa
BBB
bbbb
CCCCC
cccc
DDD
dd
E

Click to view pattern code

105.                

1
3 5 7
9 11 13 15 17
19 21 23 25 27 29 31
33 35 37 39 41 43 45 47 49

Click to view pattern code

106.                

107.                

88888888
87777777
87666666
87655555
87654444
87654333
87654322
87654321

Click to view pattern code

108.                

5 4 3 2 1
5 4 3 2
5 4 3
5 4
5

Click to view pattern code

109.                

1
A B
1 2 3
A B C D
1 2 3 4 5

Click to view pattern code

110.                

1-2-3-4-5
-2-3-4-5
--3-4-5
---4-5
----5

Click to view pattern code

111.                

1-2-3-4-5
-1-2-3-4
--1-2-3
---1-2
----1

Click to view pattern code

112.                

**********
****  ****
***    ***
**      **
*        *
**      **
***    ***
****  ****
**********

Click to view pattern code

113.                

1234512345
1234  1234
123    123
12      12
1        1
12      12
123    123
1234  1234
1234512345

Click to view pattern code

114.                

ABCDEABCDE
ABCD  ABCD
ABC    ABC
AB      AB
A        A
AB      AB
ABC    ABC
ABCD  ABCD
ABCDEABCDE

Click to view pattern code

115.                

    *
   *A*
  *A*A*
 *A*A*A*
*A*A*A*A*

Click to view pattern code

116.                

*
*A*
*A*A*
*A*A*A*
*A*A*A*A*

Click to view pattern code

117.                

      1
     1 1
    1 2 1
   1 3 3 1
  1 4 6 4 1

Click to view pattern code

118.                

119.                

A
22
CCC
4444
EEEEE

Click to view pattern code

120.                

*****
*
*
*
*

Click to view pattern code

121.                

     **
    ****
   ******
  ********
 **********
 **********
  ********
   ******
    ****
     **

Click to view pattern code

122.                

     **
    ****
   ******
  ********
 **********
  ********
   ******
    ****
     **

Click to view pattern code



For any query, comment us below.




Click
imagination hunt to read latest blogs.

Keep learning and sharing...

Comments

  1. How to print this pattern
    A
    11
    BBB
    2222
    CCCCC

    ReplyDelete
    Replies
    1. Here's your pattern code.
      http://www.imaginationhunt.com/2016/11/pattern-printing-program_28.html

      Delete

Post a Comment

Popular posts from this blog

SSC CGL 2016 Tier-1 Marks / Result

DATA TYPES IN C#

Pattern printing program

IS STRING MUTABLE OR IMMUTABLE IN .NET?

Top Mutual Funds

SSC CGL 2017 TIER 2 RESULT OUT

JUST IN TIME (JIT)

Can we have multiple Main methods in one class

TOP 15 VISUAL STUDIO SHORTCUT KEYS

Top 10 Interview Tips and Questions