Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is_prime(int candidate){
- int i=0;
- for(i=2;i<candidate;i++){
- if(candidate%i==0){
- return 0;
- }
- }
- return 1;
- }
- int main(void){
- int candidate =2;
- int n=0;
- while(n<200){
- if(is_prime(candidate)){
- printf("%5d\n",candidate);
- n++;
- }
- candidate++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement