About 767,000 results
Open links in new tab
  1. Find the position of the given Prime Number - GeeksforGeeks

    Nov 21, 2021 · Given a number N which is a prime number, the task is to find the position of the given prime number in the series of Prime Numbers. Examples : Input: N = 11

  2. java - find all prime numbers from array - Stack Overflow

    Mar 30, 2022 · So I solved it by System.out.println (array [i] + " are the prime numbers in the array "); giving me the ouput: 23 are the prime numbers in the array 101 are the prime numbers in …

  3. Check prime numbers in Array against prime index positions

    Aug 22, 2023 · Given an array arr [], the task is to check for each prime number in the array, from its position (indexing from 1) to each non-prime position index, and check if the number …

  4. java - Prime numbers in array - Stack Overflow

    Jan 20, 2014 · ArrayList primeNumbers = new ArrayList(); for (int i = 0; i <= number; i++) if(isPrime(i)) . primeNumbers.add(i); return primeNumbers; for(int i=2;i<n;i++) . if(n%i==0) …

  5. java - Find the first n prime numbers and store them in an array ...

    I need to find the first n prime numbers and store them in the array primes. With the help of stuff I found on stackoverflow I succeeded in find the first n numbers, but when I try to store them in …

  6. Java Program to find prime numbers in an array - Xiith

    In this program, You will learn how to find prime numbers in an array in java. public static void main(String[] args) { //Statement. Example: How to find prime numbers in an array in java. s = …

  7. Java program to print prime numbers from an array - Medium

    Jan 4, 2017 · To print the prime numbers from an array, user has to declare the size of the array size and enter the elements of the array. Prime numbers are identified using iterations with the...

  8. Java: Get the position of a given prime number - w3resource

    Apr 1, 2025 · Write a Java program to generate the first n prime numbers and output the position of a specified prime. Write a Java program to list all prime numbers within a given range along …

  9. Prime Number Program in Java - GeeksforGeeks

    Apr 7, 2025 · A prime number is a natural number greater than 1, divisible only by 1 and itself. Examples include 2, 3, 5, 7, and 11. These numbers have no other factors besides themselves …

  10. Write a program to Find prime and non-prime numbers in the array

    Write a program to Find prime and non-prime numbers in the array The code checks whether each element in the given array a is prime or not. It uses a nested loop to iterate over each …

  11. Some results have been removed
Refresh