In this article we will try to implement a Java program to print prime numbers from 1 to n. A Java program is provided below that prompts the user for an integer and then prints out all prime numbers up to that integer. Program is as follows: import java.util.Scanner; class Prime { void primeGen(int […]
