Bilangan Prima (java)

//nama : anna arthdi putra
//nim : 10030035

/**
*
* @author aerdy
*/
public class Prima100 {
public static void main(String[] args) {

int input = 0;
for(input=0;input= 2;input++) {
isPrime = true;

for (int i = 2; i < input; i++) {
if (input % i == 0) {

isPrime = false;
break;
}
}
}
if(isPrime==true)
System.out.println("Angka" + input + " Adalah bilangan Prima");
}
}
}

Advertisements

Published by

jarcode

hello I am jarcode

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