Program for printing Prime numbers with in given range
# include<stdio.h> #include<conio.h> void main() { int i, j, s, e, c; clrscr(); printf ( “enter range”); scanf (...
https://www.computersprofessor.com/2016/06/program-for-printing-prime-numbers-with.html
# include<stdio.h>
#include<conio.h>
void main()
{
int i, j, s, e, c;
clrscr();
printf ( “enter range”);
scanf ( “%d%d", & s, & e);
for ( i = s; i < e; i ++)
{
c=0;
for ( j =2; j < =i/2; j ++)
{
if (i%j = = 0)
c++;
}
if (c= = 0)
printf ( “%d \n “ , i);
}
getch();
}
Out Put:
enter range 2 20
2
3
5
7
11
13
17
19