diff --git a/lessons/images/pattern-print.png b/lessons/images/pattern-print.png new file mode 100644 index 00000000..090a73cb Binary files /dev/null and b/lessons/images/pattern-print.png differ diff --git a/lessons/print-patterns.md b/lessons/print-patterns.md index 17621523..2f55dfc5 100644 --- a/lessons/print-patterns.md +++ b/lessons/print-patterns.md @@ -5,3 +5,196 @@ order: "4C" section: "Arrays" description: "learn Arrays" --- + +Java pattern program enhances the coding skill, logic, and looping concepts. It is mostly asked in Java interview to check the logic and thinking of the programmer. We can print a Java pattern program in different designs. To learn the pattern program, we must have a deep knowledge of the Java loop, such as for loop do-while loop. In this section, we will learn how to print a pattern in Java. + +## **We have classified the Java pattern program into three categories:** +- Star Pattern +- Number Pattern +- Character Pattern + +### **Here we explain each category with examples :** + +## **Star Pattern :** + +_**Qn1 : Right Triangle Star Pattern**_ + +### **Code :** +```java +public class RightTriangleStarPattern +{ + public static void main(String args[]) + { + //i for rows and j for columns + //row denotes the number of rows you want to print + int i, j, row = 4; + //outer loop for rows + for(i=0; i +Happy Learning 👍 \ No newline at end of file