Program Busur Dengan Output Dibawah ini
public class busur {
public static void
main (String[] args){
System.out.print("Masukan Angka = ");
int max=new
java.util.Scanner (System.in).nextInt();
for (int
i=1;i<=max;i++){
for (int
j=1;j<=i;j++) {
System.out.print(j+" ");
}
System.out.println();
}
for(int
i=1;i<max;i++){
for (int
j=1;j<=(max-i);j++){
System.out.print(j+" ");
}
System.out.println();
}
}
}
No comments:
Post a Comment