C code keeps running forever : I am trying to find the largest prime factor of a huge number in C ,for small numbers like 100 or even 10000 it works fine but fails (By fail i mean it keeps **running and running** for tens of minutes on my core2duo and i5) for very big `target` numbers (See code for the target number.)
Is my algorithm correct?

I am new to C and really struggling with big numbers. What i want is correction or guidance not a solution i can do this using python with bignum bindings and stuff (*I have not tried yet but am pretty sure*) but not in C. Or i might have done some tiny mistake that i am too tired to realize , anyways here is the code i wrote:

    #include <stdio.h>
    // To find largest prime factor of target
    int is_prime(unsigned long long int num);
    
    long int main(void) {
    	unsigned long long int target = 600851475143;
    	unsigned long long int current_factor = 1;
    	register unsigned long long int i = 2;
    	while (i < target) {
    		if ( (target % i) == 0  && is_prime(i) && (i > current_factor) ) { //verify i as a prime factor and greater than last factor
    			current_factor = i;
    		}
    		i++;
    	}
    	printf("The greates is: %llu \n",current_factor);
    return(0);
    }
    
    
    int is_prime (unsigned long long int num) { //if num is prime 1 else 0 
    	unsigned long long int z = 2;
    	while (num > z && z !=num) {
    		if ((num % z) == 0) {return 0;}
    		z++;
    	}
    
    return 1;
    }