Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int isprime(int x)
- {
- int i;
- for(i=2 ; i*i<=x ; i++)
- if(x%i==0)
- return 0;
- if(i*i>x)
- return 1;
- }
- int main()
- {
- int n, a, b;
- printf("Enter Limit: "),
- scanf("%d",&n);
- for(a=3, b=5 ; b<=n ; a+=2, b+=2)
- if(isprime(a)==1 && isprime(b)==1)
- printf("%d %d\n",a,b);
- return 0;
- }
Add Comment
Please, Sign In to add comment