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 (...

# 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

Related

C Programs 3195635328461955712

Post a Comment

emo-but-icon

item