C program to print Prime Number between any two given limit

#include<stdio.h>
#include<conio.h>
int main()
{
 int l,u,i,x;
 printf("Enter two limits");
 scanf("%d%d",&l,&u);
 for(x=l+1;x<=u-1;x++)
 {
  for(i=2;i<x;i++)
  if(x%i==0)
  break;if(i==x)
  printf("%d \0",x);
} getch();
  return 0;

}

Post a Comment

0 Comments