Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- int czy_pierwsza(int d)
- {
- int i;
- for (i=2; i<d/2; i++)
- {
- if(!(d%i))
- return 0;
- }
- return 1;
- }
- int main()
- {
- int n, d;
- printf("Podaj liczbe: ");
- scanf("%d", &n);
- for(d=2;d<(n/2);d++)
- {
- if((n%d == 0) && czy_pierwsza(d))
- printf("%d\n", d);
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement