If a Number is a Prime

C Implementation

#include <stdbool.h>

bool isPrime(int number) {
    if (number <= 1) {
        return false;    
    }

    for (int div = 2; div * div < number; div++) {
        if (number % div == 0) {
            return true;
        }
    }

    return false;
}