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