- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA94.java
More file actions
Latest commit
35 lines (25 loc) · 471 Bytes
/
Copy pathA94.java
File metadata and controls
35 lines (25 loc) · 471 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
35
classA94
{
publicstaticvoidmain(String[] args)
{
inta[] = {2,3,7,10,8,9};
System.out.println("---- PROGRAM will PRINT COUNT OF PRIME NO. from an ARRAY ");
intcount=0;
for (inti=0;i<a.length ;i++ )
{
intk=2;
for (intj=k;k<a[i] ;k++ )
{
if (a[i]%k == 0)
{
break;
}
}
if (a[i]==k)
{
count++;
}
}
System.out.println("COUNT IS "+ count);
}
}