int populate_array(int sin, int *sin_array) {
    int digits = 0;
    int position = 0;
    while(sin != 0){
        sin_array[position] = sin % 10;
        digits += 1;
        position += 1;
        sin = sin / 10;
    }
    if (digits != 9){
        return 1;
    }
    else{
        return 0;
    }
}


int check_sin(int *sin_array) {
    int sin_total = 0;
    for (int position = 0; position < 8; position++){
        if(position % 2 == 0){
            sin_total += sin_array[position];
        }
        else{
            if (((2 * sin_array[position]) / 10) != 0){
                int temp = sin_array[position];
                while(temp != 0){
                    sin_total += temp % 10;
                    temp = temp / 10;
                }
            }
            else{
                sin_total += (2 * sin_array[position]);
            }
        }
    }
    if (sin_total % 10 == 0){
        return 0;
    }
    else{
        return 1;
    }
}
