-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathtrial.java
More file actions
38 lines (26 loc) · 727 Bytes
/
trial.java
File metadata and controls
38 lines (26 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
35
36
37
38
import java.io.*;
class prime
{
public static void main(String args[])throws IOException
{
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader y = new BufferedReader(in);
int s=0,i,j,c=0,f;
for(i=1;i<=100;i++)
{
f=i;
for(j=1;j<=i;j++)
{
if(f % j==0)
{
c++;
}
if(c==2)
{
s=s+f;
}
System.out.println(s);
}
}
}
}