Question: Question 5 [15 points). Write a function that gets an array of n ints, where each entry in the array is between 0 and 9.

 Question 5 [15 points). Write a function that gets an array

Question 5 [15 points). Write a function that gets an array of n ints, where each entry in the array is between 0 and 9. The function multiplies all these numbers and outputs the result as a string. The reason it needs to output a string (and not an int) is because the result might be too large to fit into an int/long. You may assume that n>0. char* mult_digits (const int* digits, int n); For example: - mult_digits ([3], 1) returns "3". - mult_digits ([9,9), 2) returns "81". mult_digits ( [5,5,4,5,5], 5) returns "2500". mult_digits ([1,2,2,2,1,2,4,4,2,2), 10) returns "1024". mult_digits ( [9,9, 9, 9, 9, 9, 9, 9, 9, 9, 9,9, 9,9,9,9,9,9,9,9), 20) returns "12157665459056928801". 1. You may assume that the input is always legal, i.e., 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!