Answers for "allintitlle:Java program to print prime numbers from 2 to n"

2

Java program to print prime numbers from 2 to n

// Java program to print prime numbers from 2 to n
import java.util.Scanner;
public class PrimeNumberFrom2Ton
{
   public static void main(String[] args) 
   {
      int loop, max;
      System.out.print("Please enter highest (maximum) number: ");
      Scanner sc = new Scanner(System.in);
      max = sc.nextInt();
      for(loop = 2; loop < max; ++loop)
Posted by: Guest on February-19-2021

Code answers related to "allintitlle:Java program to print prime numbers from 2 to n"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language