import java.util.Scanner;
public class SikuKananTerbalik {
public static void main(String[] args) {
System.out.print("Masukkan Banyak Baris: ");
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
for(int i=1; i<=x; i++) {
for(int j=1; j<i; j++) {
System.out.print(" "); //Spasi
}
for(int k=x; k>=i; k--) {
System.out.print("*"); //Bintang
}
System.out.println("");
}
}
}
public class SikuKananTerbalik {
public static void main(String[] args) {
System.out.print("Masukkan Banyak Baris: ");
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
for(int i=1; i<=x; i++) {
for(int j=1; j<i; j++) {
System.out.print(" "); //Spasi
}
for(int k=x; k>=i; k--) {
System.out.print("*"); //Bintang
}
System.out.println("");
}
}
}
Jika masih bingung bisa lihat video tutorial dibawah ini ya 😁😁
No comments:
Post a Comment