Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n=1;
- int two=2;
- printf("%5d ",two);
- for(int a=3;a<1000;a++)
- {
- int count=0;
- for(int i=2;i<a;i++)
- {
- if(a%i==0)
- {
- count++;
- }
- }
- if(count==0)
- {
- printf("%5d ",a);
- n++;
- if(n%10==0)
- {
- printf("\n");
- }
- }
- }
- printf("\n");
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement