import java.util.Scanner;
public class SikuKiri {
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=x-1; j>=i; j--) {
System.out.print(" "); //Spasi
}
for(int k=1; k<=i; k++) {
System.out.print("*"); //Bintang
}
System.out.println("");
}
}
}
public class SikuKiri {
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=x-1; j>=i; j--) {
System.out.print(" "); //Spasi
}
for(int k=1; 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