In this article, you will learn to print all the prime numbers between a given interval.
What is a Prime number?
Step to create these programs:
- First, we take the first number as 1
- Then we take the second number from the user
- Then we iterate the for loop from first to last+1
- Then we check the number is greater than 1
- Then we iterate again for the second loop from 2 to num
- Then we check the num, divide the num from the for loop and the check is equal to zero
- Otherwise, print num