Java - Menampilkan Symbol Bintang Sesuai Inputan
Java ini dibuat di JCreator 5.0
Soutce Code:
/**
* @(#)bintang.java
* @author Moch. Afif
* @version 1.00 2014/1/30
*/
import java.util.Scanner;
public class bintang {
public static void main(String []args) {
Scanner input = new Scanner(System.in);
System.out.println("Masukan Jumlah Angka :");
int m=input.nextInt();
int i,j;
System.out.println("Muncul Jreng-jreng:");
for (i=1;i<=m;i++){
for (j=1;j<=i;j++){
System.out.print("*");
}
System.out.println("\n");
}
}
}
Comments
Post a Comment