Posted in Program Java

Program Java Membuat Bintang-bintang

Assalamu’alaikum , selamat malam bloggersπŸ™‚

Udah lama nih gak post tentang pemrograman, curhat mulu isi blog nya nih, harap maklum ya jobseeker yang lagi galau nih hehe :p
Oke, mari kita mulai belajar, kali ini kita masih belajar pemrograman java dasar yaitu program membuat bintang-bintang di java.

Program java membuat bintang siku

package bintangbintang;
import java.util.Scanner;
/**
*
* @author Rifa'atul Mahmudah
*/
public class BintangBintang {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner input = new Scanner(System.in);
int i,j,n;

System.out.println("Masukkan jumlah bintang : ");
n=input.nextInt();

for(i=1;i<=n;i++){
for(j=1;j<=i;j++)
System.out.print("*");
System.out.println();
}
}
}

Output Program

1

Sekian, Semoga Bermanfaat

Author:

Give your best

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s