Answers for "Write a program to print the down arrow pattern in java"

0

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(""); } } }
Posted by: Guest on June-10-2021

Code answers related to "Write a program to print the down arrow pattern in java"

Browse Popular Code Answers by Language