Hey everyone, I'm trying to get this code to work...
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
int allPrimes(int n)
{
int kiloN = n*1000;
int count = 0;
int i;
for(i = 2; i <= kiloN; i++)
{
boolean hasfactor = false;
int j = 2;
while(j<i and !hasfactor)
{
if(i%j=0)
{
hasfactor = true;
}
if(hasfactor)
{
printf(i);
count++;
}
}
}
printf("Count: %d",count);
return count;
}
Errors keep popping up.
Any help?