You are on page 1of 2

Input: Two numbers of two digits

Output: The multiplication of these two numbers

Introduce a number with 2 digits

In left-right order, call the digits 1A and 1B

Introduce another number with 2 digits

In left-right order, call the digits 2A and 2B

Multiply 2B with 1B

Save the result as X1

If X1 has 1 digit, save it as P1 and declare C1 as 0

If X1 has 2 digits, in left-right order, call the digits C1 and P1

Multiply 2B and 1A

Save the result as X2 and add C1. Save the result as V1

If V1 has one digit, save it as P2 and save P3 as 0

If the V1 has two digits, in left-right order, call it P3 and P2

Multiply 2A with 1B

Save the result as X3

If X1 has 1 digit, save it as P4 and declare C2 as 0

If X1 has 2 digits, in left-right order, call the digits C2 and P4


Multiply 2A and 1A

Save the result as X4 and add C2. Save the result as V2

If V2 has one digit, save it as P5 and P6 as 0

If the V2 has two digits, in left-right order, call it P6 and P5

Save P1 as R1

Add P2 and P4, save the result as R2

Add P3 and P5, save the result as R3

Save P6 as R4

If R4>0

Order the following by left-right order: R4, R3, R2, R1

If R4=0:

Order the following by left-right order: R3, R2, R1

You might also like