how to make trapezium in java
Answers
Answered by
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.........!!!!???!!
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
India Languages,
7 months ago
Math,
7 months ago
Science,
1 year ago
Biology,
1 year ago
Math,
1 year ago