#include <conio.h>
int main(int argc, char* argv[])
{
int start = 0 , end = 0 ;
printf("Enter the starting number in range");
scanf_s("%d",&start);
printf("Enter the ending number in range");
scanf_s("%d",&end);
for (int i = start; i < end ; i++)
{
int count = 0;
for(int j = 1 ; j <= i ; j++)
{
if ( i % j == 0 )
{
count++;
if ( count > 2)
{
break;
}
}
}
if ( count <= 2 )
{
printf("%d\n",i);
}
}
getch();
return 0;
}
No comments:
Post a Comment