Bilangan Prima

Run Settings
LanguageJava
Language Version
Run Command
public class Main { public static void main(String[] args) { int number = 1; boolean isPrime = true; for (int i = 2; i <= number / 2; i++) { if (number % i == 0) { isPrime = false; break; } } if (isPrime) { System.out.println(number + " is a prime number"); } else { System.out.println(number + " is not a prime number"); } } }
Editor Settings
Theme
Key bindings
Full width
Lines