import java.util.*;
public class Pattern4 {
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
System.out.println("Please enter no. of rows to be printed:");
int n = in.nextInt();
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i+j<=(n-1)) {
System.out.print("#");
}
}
System.out.println("");
}
in.close();
}
}
Comments
Post a Comment
THANK YOU FOR COMMENTING !
PLEASE SUBSCRIBE TO OUR WEBSITE FOR LATEST UPDATES