Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int m,n,num,d;
- printf("Enter two numbers: ");
- scanf("%d%d",&m,&n);
- for(num=m;num<=n;num++)
- {
- for(d=2;d<num;d++)
- {
- if(num%d==0)
- {
- break;
- }
- }
- if(d==num)
- {
- printf("The prime number is %d\n",num);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement