Given a number n, check whether it’s prime number or not using recursion.
Input : n = 11 Output : Yes Input : n = 15 Output : No
The idea is based on school method to check for prime numbers.
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Recursive sum of digits of a number is prime or not
- Recursive program to find all Indices of a Number
- Recursive program to check if number is palindrome or not
- Recursive Program to print multiplication table of a number
- Program to find the next prime number
- Program to find the Nth Prime Number
- C Program to Check Whether a Number is Prime or not
- Python program to check whether a number is Prime or not
- C Program for efficiently print all prime factors of a given number
- Efficient program to print all prime factors of a given number
- Java Program for efficiently print all prime factors of a given number
- Print the nearest prime number formed by adding prime numbers to N
- Check if a number is Prime, Semi-Prime or Composite for very large numbers
- Count occurrences of a prime number in the prime factorization of every element from the given range
- Recursive program to generate power set
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.