Anonymous user
ISBN13 check digit: Difference between revisions
m
→{{header|IS-BASIC}}
Line 875:
260 END DEF
270 DEF ISBN(S$)
280 LET SUM,ISBN=0:LET ISBN$=TRIM$(IS$)
290 IF LEN(ISBN$)<>13 THEN PRINT "Invalid length."
300 FOR I=1 TO 11 STEP 2
310 LET SUM=SUM+VAL(ISBN$(I))+VAL(ISBN$(I+1))*3
320 NEXT
330 LET SUM=SUM+VAL(ISBN$(13))
340 IF MOD(SUM,10)=0 THEN LET ISBN=-1
350 END
=={{header|Julia}}==
|