fork download
  1. #include <stdio.h>
  2.  
  3. void PrimeNumBw2Num(int a,int b)
  4. {
  5. int i,j;
  6. for(i=a+1;i<b;i++)
  7. {
  8. for(j=2;j<=i;j++)
  9. {
  10. if(i%j==0)
  11. break;
  12. }
  13. if(i==j)
  14. printf("%d ",i);
  15. }
  16. }
  17. int main(void) {
  18. int a,b;
  19. printf("Enter two number(starting and ending): ");
  20. scanf("%d%d",&a,&b);
  21. PrimeNumBw2Num(a,b);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5288KB
stdin
50 200
stdout
Enter two number(starting and ending): 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199