Write a program to print the down arrow pattern in java code example
Example: Write a program to print the down arrow pattern in java
public class Main{ public static void main(String[] args){ int lines=6; int i,j; for(i=1;i<=lines;i++){for(j=1;j<=lines;j++){ if(i==j) System.out.print("*"); else System.out.print("1"); } j--; System.out.print("*"); while(j>=1){ if(i==j) System.out.print("*"); else System.out.print("1"); j--; } System.out.println(""); } } }