katagorinya adalaaahh pemrograman JAVA ... :tiupteropet:
ini Segitiga Sama Sisi:
coba dipahami yaa
lalu buat baru
public class SegitigaSamaKaki {
public static void main(String[] args){
for(int i=1;i<=6;i++){
for(int x=(6-i);x>=1;x--){
System.out.print(" ");
}
for(int y=(i*2)-1;y>=1;y--)
System.out.print("*");
System.out.println("");
}
}
}
Segitiga Siku-Siku:
public class Segitiga {
public static void main(String[] args) {
for(int i=1;i<5;i++){
for(int x=1;x<=i;x++){
System.out.print("*");
}
System.out.println("");
}
// TODO code application logic here
}
}
0 komentar:
Post a Comment