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