#include <stdio.h>
#include <stdlib.h>
int main() {
    int sin_array[9] = {1,2,3,4,5,6,7,8,9};
    // Multiplying every 2nd digit by 2
    for (int i = 0; i < 9; i++) {
        // For odd i
        if (i % 2 != 0) {
            if (sin_array[i] * 2 >= 10) {
                int temp = sin_array[i] * 2;
                int sum_of_digits = 0;
                while (temp > 0) {
                    int remainder = temp % 10;
                    temp = temp / 10;
                    sum_of_digits += remainder;
                }
                sin_array[i] = sum_of_digits;
            }
            else {
                sin_array[i] *= 2;
            }
        }
    }
    // Add all sin_array digits together 
    int sum = 0;
    for (int i = 0; i < 9; i++) {
        sum += sin_array[i];
    }
    // Check if SIN is valid 
    if (sum % 10 == 0) {
        printf("%s\n", "Valid Sin");
        return 0; // It is valid
    }
    else {
        printf("%s\n", "Invalid");
        return 1;
    }
}
Does not have a runtime error