Crown Pattern in Java
The pattern programs are usually asked in interviews to check the logic implementation and loop concepts. In the previous section, we have discussed the various patterns like, triangle, tree, star, etc. In this section, we will learn how to print pattern of crown through a Java program using different logics.
We have divided the Crown Pattern in two sections. The first section contains the first five rows of the crown. The second section contains the last two rows of the crown, as we have shown in the following figure.
Let's implement the above logic in a Java program.
Let's see another logic.
In the following program, we can enter number of rows and character that we want to print.
Next TopicConvert List to Array in Java