10 Different Number Pattern Programs In Java

Pattern programs in Java

Pattern programs in Java are one of the frequently asked interview questions, particularly for freshers. These questions basically test the coding skills of the candidate. In this article, we have listed some of the most common pattern programs and tried to solve them. Hope you find them useful.

Pattern 1 :

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

1 2 3 4 5 6

1 2 3 4 5 6 7

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

1 2 3 4 5 6

1 2 3 4 5 6 7

 

Pattern 2 :

1

2 2

3 3 3

4 4 4 4

5 5 5 5 5

6 6 6 6 6 6

7 7 7 7 7 7 7

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

1

2 2

3 3 3

4 4 4 4

5 5 5 5 5

6 6 6 6 6 6

7 7 7 7 7 7 7

 

Pattern 3 :

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

1 2 3 4 5 6

1 2 3 4 5 6 7

1 2 3 4 5 6

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

1 2 3 4 5 6

1 2 3 4 5 6 7

1 2 3 4 5 6

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1

Pattern 4 :

1 2 3 4 5 6 7

1 2 3 4 5 6

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

1 2 3 4 5 6 7

1 2 3 4 5 6

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1

Pattern 5 :

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

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

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

Pattern 6 :

7

7 6

7 6 5

7 6 5 4

7 6 5 4 3

7 6 5 4 3 2

7 6 5 4 3 2 1

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

7

7 6

7 6 5

7 6 5 4

7 6 5 4 3

7 6 5 4 3 2

7 6 5 4 3 2 1

Pattern 7 :

7 6 5 4 3 2 1

6 5 4 3 2 1

5 4 3 2 1

4 3 2 1

3 2 1

2 1

1

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

7 6 5 4 3 2 1

6 5 4 3 2 1

5 4 3 2 1

4 3 2 1

3 2 1

2 1

1

Pattern 8 :

1 2 3 4 5 6 7

1 2 3 4 5 6

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

1 2 3 4 5 6

1 2 3 4 5 6 7

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

1 2 3 4 5 6 7

1 2 3 4 5 6

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

1 2 3 4 5 6

1 2 3 4 5 6 7

Pattern 9 :

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

1 2 3 4 5 6 5 4 3 2 1

1 2 3 4 5 6 7 6 5 4 3 2 1

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

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

1 2 3 4 5 6 5 4 3 2 1

1 2 3 4 5 6 7 6 5 4 3 2 1

Pattern 10 :

1

2 1

3 2 1

4 3 2 1

5 4 3 2 1

6 5 4 3 2 1

7 6 5 4 3 2 1

Java Program :

Output :

How many rows you want in this pattern?

7

Here is your pattern….!!!

1

2 1

3 2 1

4 3 2 1

5 4 3 2 1

6 5 4 3 2 1

7 6 5 4 3 2 1

Hope this post was beneficial to you. Leave your thoughts in the comment section below. Thanks for visiting. Keep coming back for more updates!

print

Leave a Reply

Your email address will not be published. Required fields are marked *