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