Jump to content

ISBN13 check digit: Difference between revisions

m
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.":LET ISBN=0:EXIT DEF
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 LET ISBN=0DEF</lang>
360 ELSE
370 LET ISBN=-1
380 END IF
390 END DEF</lang>
 
=={{header|Julia}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.