Multiplicator X84546


Statement
 

pdf   zip   main.cc

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×2 \times size digits, using leading zeroes when needed. Consider 11 \leq size 100\leq 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
Language
English
Official solutions
C++
User solutions
C++