About 1,660,000 results
Open links in new tab
  1. Java Program to display first n or first 100 prime numbers

    Sep 10, 2022 · Program to display first n prime numbers. n = scanner.nextInt(); if (n >= 1) { System.out.println("First "+n+" prime numbers are:"); //2 is a known prime number …

  2. Java Program to Print first 100 Prime Numbers - Tutorial …

    Write a Java program to print the first 100 prime numbers using for loop. public static void main(String[] args) { . int i, num = 3, status = 1; System.out.println("First 100 Prime Numbers …

  3. Java Program to Print Prime Numbers - W3Schools

    This Java program demonstrates how to calculate and print prime numbers. Whether you aim to print prime numbers from 1 to 100 in Java or want to understand the logic behind identifying a …

  4. Java program to display prime numbers from 1 to 100 and 1 to n

    Sep 10, 2022 · Here we will see two programs: 1) First program will print the prime numbers between 1 and 100 2) Second program takes the value of n (entered by user) and prints the …

  5. java - Printing prime number from 1 to 100 - Stack Overflow

    Here is the simplest version of the code for finding prime numbers between 1 to 100. import java.io.*; import java.util.*; class solution { public static void main(String args[]) { Scanner scan …

  6. Java Program to Print Prime Numbers from 1 to N - Tutorial …

    In this article, we show how to write a Java program to Print Prime Numbers from 1 to N using For Loop, While Loop, and Functions.

  7. java - Printing the first N prime numbers - Stack Overflow

    The statement is: Write a program that reads an integer N and prints the first N prime numbers. public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.

  8. Java Program to Print First 100 Prime Numbers - javabytechie

    Aug 13, 2022 · On this tutorial page we are going to learn how to write a Java program to print first 100 prime number. A prime is a natural number that is greater than 1 and divided by 1 or …

  9. Java Program - Display First 100 Prime Numbers - Learn …

    Dec 20, 2022 · STEP 1: Declare the class PrmNum with a public modifier. STEP 2: Open the main () to start the program, and declare the integer variables i, j,fct_count,prm_count. STEP …

  10. Prime Number Program in Java to Check & Print Prime Numbers

    Mar 24, 2025 · Learn how a prime number program in Java can be used to print prime numbers. Explore different methods to check prime numbers from 1 to 100.

Refresh