Multiplicator X53102


Statement
 

pdf   zip   main.cc

html

Implement the function

int* multiply(int* in1, int* in2, int size);

The function receives two arrays of the given size, having integers between 0 and 9 in each position, so that the whole array represents a number. It should return a different array, allocated by the function, containing the product of the two numbers, stored in the same way than the arguments it receives. The result should contain 2 × size digits, using leading zeroes when needed. Consider 1 ≤ size ≤ 100.

For example, for these input arguments

in1 = [3, 8] in2 = [1, 5] size = 2

your function should return

out = [0, 5, 7, 0]

Observation You only need to submit the required procedure; your main program will be ignored.

Information
Author
Xanadu Trading
Language
English
Official solutions
C++
User solutions
C++