import java.util.Scanner;
public class SamaSisiTerbalik {
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=i; k<=x; k++) {
System.out.print(" *"); //Bintang
}
System.out.println("");
}
}
}
public class SamaSisiTerbalik {
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=i; k<=x; k++) {
System.out.print(" *"); //Bintang
}
System.out.println("");
}
}
}
Jika masih bingung bisa lihat video tutorial dibawah ini ya 😁😁
No comments:
Post a Comment