cara membuat bintang
package bintang;
public class Main {
public static void main(String[] args) {
for (int i=1;i<=5;i++){
for(int j=1;j <=i;j++){
System.out.print("*");
}
System.out.println();
}
}
}
-------------------------------------------------
anak ayam
package anakayam;
public class Main {
public static void main(String[] args) {
int x=99;
System.out.println("anak ayam=100");
while (x>=1){
System.out.print("mati 1 tinggal="+x);
x--;
System.out.print("\n");
}
}
}
komenTAR ANDA
package bintang;
public class Main {
public static void main(String[] args) {
for (int i=1;i<=5;i++){
for(int j=1;j <=i;j++){
System.out.print("*");
}
System.out.println();
}
}
}
-------------------------------------------------
anak ayam
package anakayam;
public class Main {
public static void main(String[] args) {
int x=99;
System.out.println("anak ayam=100");
while (x>=1){
System.out.print("mati 1 tinggal="+x);
x--;
System.out.print("\n");
}
}
}
komenTAR ANDA
Tidak ada komentar:
Posting Komentar