Validating isbn 10 c
/* Check digit calculation is based on modulus 10 with digits in an odd position (from right to left) being weighted 1 and even position digits being weighted 3.
For further information on EAN-13 see: Wikipedia - European Article Number: Implementation based on Tests can be found there too */ boolean is Valid Ean(String code) users_gtin=raw_input("enter first seven digits of gtin ") gtin_seven_digits=unicode(users_gtin) if len(gtin_seven_digits) == 7 and gtin_seven_digits.isnumeric(): ck = ((((int(gtin_seven_digits)) (int(gtin_seven_digits)) (int(gtin_seven_digits)) (int(gtin_seven_digits)))*3) ((int(gtin_seven_digits)) (int(gtin_seven_digits)) (int(gtin_seven_digits)))) final_ck = 10-ck if final_ck == 10: final_ck=0 print "Is your check digit",final_ck,"?
In the case of the old 10-digit ISBN the check digit can be any number from zero to nine, and it can also be a letter "x", like a Roman ten.
The following code uses linq to check the last digit for GTIN barcodes: GTIN-8, GTIN-12 (UPC), GTIN-13 (EAN) and GTIN-14 (ITF-14).It splits the given string into a pair of substrings, the first containing all characters but the last, and the second containing just the last character.This pair is passed to an Arrow (created using the (parsing each entry in the list into a number) and the second component into the first element of the list.An ISBN-10 control digit is calculated by multiplying each digit with its one-based index and taking the remainder from the integer division by eleven.For example: ISBN: This completes the control digit calculation function.
I'm aware that the question is in the context of .net/C#.