In the prime exercise of practice problems 1 I am encountering the following error for the code below: non-void function does not return a value in all control paths [-Werror, Wreturn-type]
#include <cs50.h>
#include <stdio.h>
bool prime(int number);
int main(void)
{
int min;
do
{
min = get_int("Minimum: ");
}
while (min < 1);
int max;
do
{
max = get_int("Maximum: ");
}
while (min >= max);
for (int i = min; i <= max; i++)
{
if (prime(i))
{
printf("%i\n", i);
}
}
}
bool prime(int number)
{
for (int j = 1; j < number; j++)
{
if (number % j != 0)
{
return false;
}
}
}