Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- bool licz_p(x)
- {
- if ((x==0) || (x==1) || (x==2))
- {
- return false;
- }
- int i;
- for (i=2; i<x; i++)
- {
- if (x%i==0)
- return true;
- }
- return false;
- }
- main()
- {
- int i,j,n=0;
- printf("Ile liczb?: ");
- scanf("%d",n);
- while (i<n)
- {
- if (licz_p(j))
- {
- i++;
- printf("%d",j);
- }
- j++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement