How to resolve the algorithm ISBN13 check digit step by step in the K programming language

Published on 12 May 2024 09:40 PM
#K

How to resolve the algorithm ISBN13 check digit step by step in the K programming language

Table of Contents

Problem Statement

Validate the check digit of an ISBN-13 code:

You might use the following codes for testing:

Show output here, on this page

Let's start with the solution:

Step by Step solution about How to resolve the algorithm ISBN13 check digit step by step in the K programming language

Source code in the k programming language

digits: {x[&(x>"/")&x<":"]-"0"}
isbn13c: 0=10!+/{x*(#x)#1 3} digits@

isbn13c "978-0596528126"
1
isbn13c "978-0596528120"
0
isbn13c " 978-1788399081"
1
isbn13c "978-1788399083"
0


  

You may also check:How to resolve the algorithm Statistics/Basic step by step in the Wren programming language
You may also check:How to resolve the algorithm HTTPS step by step in the RLaB programming language
You may also check:How to resolve the algorithm Sisyphus sequence step by step in the Java programming language
You may also check:How to resolve the algorithm Bitmap/Bézier curves/Cubic step by step in the C programming language
You may also check:How to resolve the algorithm Program name step by step in the UNIX Shell programming language