ちゃんとインデントしないから,わかんないんじゃない?
ちなみにデバッガ持ってる?

is_prime = 1;
for(i=2; i<=num/2; i++){
if((num%i)==0){
is_prime = 0;
break;
}
}