Muhammad Jihad 5210105011 Flowchart Bilangan Prima

Y

N

Y

N

Y

N

if (n <= 0) { System. System. int n.err.println("Masukkan Bilangan :"). System.out.nextInt().out.Muhammad Jihad 5210105011 Source Code : import java. a++) { if (n % a == 0) { prime = false.println(n + " Bilangan Komposit ").out.println(n + " Bilangan Prima "). boolean prime = true. } } } . a*a <= n.util.err. n = input. } else { System. } else if (n == 1) { System.println("1 Bukan Bilangan Prima atau Komposit"). a.println("Input Hanya Positive Integer").exit(0). } } if (prime) { System. System. } for (a = 2.Scanner.in).exit(0). /** * * @author FreaksMJ / MUHAMMAD JIHAD / 5210105011 */ public class primeornot { public static void main(String[] args) { Scanner input = new Scanner(System.

Sign up to vote on this title
UsefulNot useful