Performs a UPC check on a given number -- C program