About 284,000 results
Open links in new tab
  1. Recursive program for prime number - GeeksforGeeks

    Jan 27, 2022 · In this article, you will see how you can write the logic of stored procedure to generate prime numbers for any given input. Title : Given a number N print all the prime …

  2. recursion - Java: Find out if a number is prime recursively - Stack ...

    Aug 9, 2017 · I'm writing a function that returns true if a number is prime, and false otherwise. Here is my current code: public static boolean checkPrime(int n, int currDivisor){ if(n < 2){ …

  3. Printing prime numbers in Java using recursion - Stack Overflow

    Jul 22, 2014 · Below is the code, which checks if a number is prime recursively. Compilation says, i'm missing a return statement. The number to be checked if a prime is x. The variable i is the …

  4. Prime Number Using Recursion in Java - PrepInsta

    Here, we will discuss the program for prime number using recursion in Java. We are given with a number and need to check if its prime or not.

  5. 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 …

  6. Check if a number is prime using recursion - Stack Overflow

    Dec 2, 2018 · return isPrimeRecursive(n, i + 2); if (n <= 2 || n % 2 == 0) { return (n == 2); return isPrimeRecursive(n, 3); System.out.println(isPrime(Integer.parseInt(args[0]))); With your code, …

  7. Java Program to Check whether a Number is Prime or Not using Recursion

    This is a Java Program to Find if a Number is Prime or Not using Recursion. A number is said to be a prime number if it is divisible only by itself and unity. Enter an integer as an input. Now we …

  8. Prime Number Java Program – 1 to 100 & 1 to N | Programs - Java

    Apr 17, 2025 · Using Recursion; A PRIME NUMBER is any number that is divisible by 1 and itself only. Certain examples of prime numbers are 2, 3, 5, 7, 11 etc. However, 1 is neither a prime …

  9. Check Prime Number in Java [3 Methods] - Pencil Programmer

    Enter a number: 3 It’s Prime. Method 3: Using Recursion. We can also check whether a number is prime or not using a recursive function.

  10. Prime Number Program in Java: Check a number is prime or not - Edureka

    Jul 5, 2024 · In this java program, I will take a number variable and check whether the number is prime or not. The isPrime(int n) method is used to check whether the parameter passed to it is …

  11. Some results have been removed
Refresh