Advertisement
Vasilena

PracticeDayThreeExercise1

Jul 7th, 2021
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int isPrime(int n){
  5.     for(int i = 2; i < n; i++){
  6.         if(n % i == 0){
  7.             return 0;
  8.         }
  9.     }
  10.     return 1;
  11. }
  12.  
  13. int main(){
  14.     printf("%s\n", isPrime(13) ? "Yes" : "No");
  15.     return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement