Question: Task 2 : Sum of two arrays ( 8 points ) Code with risc - v to implement adding elements in array A and B

Task 2: Sum of two arrays (8 points)
Code with risc-v to implement adding elements in array A and B as a new array C. Save your
work as task2.s. A and B have x and y elements respectively (x and y may not be equal). In C ,
ci=ai+bi, where ai and bi are elements from A and B.z is the size of C. If A and B do not have the
same length, bring the rest of elements in the longer array to the C directly. Print all elements in
C to the screen.
For example:
Input: {:[A=(2,4,6)]B=(1,3)x=3y=4z=3C=(0,0,0)
Output:
C=(3,7,6)
Test your program with different values of A and B. Please save the screenshot of the two test
cases below.
Task 2 : Sum of two arrays ( 8 points ) Code with

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 Programming Questions!