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