how to print all prime number between intervals in c ?
#include<stdio.h>
int main() {
int low, high, flag;
int i;
//take inputs
printf("enter intervals: ");
scanf("%d%d", &low, &high);
// start loop for starting value to ending value
while(low<high){
// update value of flag
flag = 0;
// ignore value which less the 2
if(low < 2){
++low;
continue;
}
// logic for check prime number
for(i = 2; i<= low/2; ++i){
if(low % i == 0){
flag = 1;
break;
}
}
if( flag == 0){
printf("%d\n", low);
}
// increment the values
++low;
}
}
.
.
.
Follow on Instagram : technicalflow
Link: https://instagram.com/technicalflow?igshid=158oh5ri58tti
Link: https://technical2k20.blogspot.com
Link: https://instagram.com/technicalflow?igshid=158oh5ri58tti
Link: https://technical2k20.blogspot.com
#technology #cybersecurity #hacking #security #hackingtools #hackingtips
#kalilinux #linux #macaddress