# C program to find the prime numbers between any two Intervals

## C program to find the primenumbersbetween any two Intervals

This page has a C program to find prime numbers between any two Intervals. Prime numbers are Integer numbers which can not be divided by any other integer numbers except one (1) and the number itself.  Few examples of prime numbers are 2, 3, 5, 7, 11, 13 17, etc. The below given C program is used to list (print or display) prime numbers between any two Intervals. Kindly check out the program to find the prime numbers between any two Intervals. The questions to find the prime numbers between any two Intervals can be asked as,

1). C program to find the prime numbers between two Intervals
2). C Program to print the prime numbers between any two Intervals
3). C Program to display the prime numbers between any two Intervals

4). Print prime numbers between any two Intervals

5). C program to list the prime numbers between any two Intervals

6). C program to find and display the prime numbers between two Intervals

### Prime numbers between any two Intervals:

#include<stdio.h>
int main(){
int n, numbr1, numbr2, k, remark;
printf("\n Enter any two Numbers : ");
scanf("%d %d",&numbr1,&numbr2);
printf("\n\n The Prime Numbers between the given Two Intervals are . . . \n ");
for(n=numbr1; n<=numbr2; ++n)
{
remark=0;
for(k=2;k<=n/2;k++){
if((n % k) == 0){
remark++;
break;
}
}
if(remark==0)
printf("\n %d ", n);
}
getch();
return 0;
}

Sample Outputs:

Enter any two Numbers : 10   20
The Prime Numbers between the given Two Intervals are . . .

11
13
17
19

Related Popular Posts: