-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay 85.txt
More file actions
34 lines (33 loc) · 727 Bytes
/
Day 85.txt
File metadata and controls
34 lines (33 loc) · 727 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
34
class Main
{
public static void main(String[]args)
{
int m=0,n,flag=0;
n=4;
//m=n/2;
if(n==0||n==1)
{
System.out.println(n+" It is not a prime number");
}
else if(n==2)
{
System.out.println(n+ " It is a prime number");
}
else
{
for(int i=2;i<n;i++)
{
if(n%i==0)
{
System.out.println("It is not a prime number");
flag=1;
break;
}
}
if(flag==0)
{
System.out.println("It is a prime number");
}
}
}
}