waleed

Anonymous
plain_text
09/26/2022 5:01 PM
704 B
17
Indexable
 public static void main(String[] args) {

        
        int n;
        
        do {
           n= Integer.parseInt(JOptionPane.showInputDialog("enter the number of rows"));
        }
        while( n<=0 );
        
        for (int z=1; z<=n ; z++) {
            
        
        for (int i=z; i<n; i++)
        {
            System.out.print(" ");
        }
            for (int j=1; j<=n*2; j++)
            {
                System.out.print("*");
            }
 
            System.out.println();
Editor is loading...