Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
3.A
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' // Razak-7051 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int n,p; Scanner s=new Scanner(System.in); System.out.println("Enter a number: "); n=s.nextInt(); for(int i=2;i<n;i++) { p=0; for(int j=2;j<i;j++) { if(i%j==0) p=1; } if(p==0) System.out.println(i); } } }
run
|
edit
|
history
|
help
0
JDBC with lambda
ZonedDateTime testing
HelloWorld2
Fireball Plugin
output2
MAP List Iterator
2
palin
Frequency
quickSort_LinkedList