Pattern printing programs

Write a program to print different type of pattern

1. Floyds triangle pattern
Input:  3

  1
 2 3
4 5 6

2. Triangle in a pyramid shape
           *
           * *
          * * *
         * * * *
        * * * * *
       * * * * * *
      * * * * * * *

3. Print Reverse Triangle

Java

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

4. Print Square Pattern number row-wise

Java

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

5. Print triangle
*
* *
* * *
* * * *
* * * * *

6. Print square pattern
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *

7. Print triangle left to right
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*




No comments:

Post a Comment