int check_sin(int *sin_array) {
  int sin_total = 0;
  for (int i = 0; i < 9; i++){
    if (i % 2 == 0){
      int result = sin_array[i] * 2; //multiplies every second digit by 2
      if (result >= 10) {
        sin_total += 1 + (result % 10);
      } 
      else {
       sin_total += result; 
      }
    } 
    else {
      sin_total += sin_array[i];
    }
  }
  if (sin_total % 10 == 0){
    return 0;
  } else {
    return 1;
    }
}
it takes an 9 element integer array representing a candidate SIN number. It returns 0 if the number given is a valid Canadian SIN number, and 1 otherwise.