Computer Science, asked by AmriteshRajput62, 1 year ago

how to make trapezium in java

Answers

Answered by Anonymous
0
Source Code:

package javaapp;

public class Woirk {

    public static void main(String[] args){


       int k = 10;//number of spaces
       int d = 20;//number of stars
       
       //loop for 10 lines
        for(int i = 0; i < 10; i++){
            
             for(int l = k; l > 1; l--){
                System.out.print("  ");//two spaces
            }           
            //loop for d stars
            for(int j = 0; j < d; j++){
                System.out.print("*");
            }
            
             System.out.println();
             
             k--;//discriminate the number of spaces
             d = d+4;//increment the number of stars
        }
    }
    
}
PLEASE MARK ME AS BRAINLIEST.........!!!!???!!
Similar questions