Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class primeNumbers {
- public static void main(String[] args) {
- int i, x, flag;
- for (x = 2; x <= 100; x++) {
- flag = 0;
- for (i = 2; i < x; i++) {
- if (x % i == 0) flag = 1;
- }
- if (flag == 0) System.out.println(x);
- }
- }
- }
Add Comment
Please, Sign In to add comment