Question: Write a function in C programming, called constantMultiple, that multiplies positive values in an array by a constant and multiplies negative values in an array

Write a function in C programming, called constantMultiple, that multiplies positive values in an array by a constant and multiplies negative values in an array by a different constant. Print out the resulting array after your function is called. Function outputs: the modified array (arrays are automatically passed by pointer so your function should return void) Function inputs: an array, the size of the array, an integer to multiply the positive values by, an integer to multiply the negative values by.

Example output with a positive multiplier of 2 and a negative multiplier of 4 entered in as [2, 4]:

Positive multiplier and negative multiplier [P, N]:

Seed:

Original array: 6 -9 -7 2 -5 9 -10 9 8 -3

Modified array: 12 -36 -28 4 -20 18 -40 18 16 -12

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!