forked from OOP-ADF/Task_1
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrimeNumber.java
More file actions
Latest commit
33 lines (23 loc) · 659 Bytes
/
Copy pathPrimeNumber.java
File metadata and controls
33 lines (23 loc) · 659 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
packagetask2;
importjava.util.Scanner;
/**
*
* @author RakaSetya
*/
publicclassTask2 {
publicstaticvoidmain(String[] args) {
Scannerinput = newScanner(System.in);
System.out.println("Masukkan angka: ");
inta = input.nextInt();
intb = 0;
for (inti = 1;i<=a;i++)
{
if (a%i==0)
b+=1;
}
if (b==2)
System.out.println("Angka yang anda Inputkan adalah Bilangan Prima");
else
System.out.println("Angka yang anda Inputkan adalah Bukan bilangan prima");
}
}