Assignment 7
Assignment 7
Spring 2022-23
INSTRUCTIONS
a) All programs should be written in C.
b) The file containing your solution to problem ‘x’ should be named roll-week7-probx.c where ‘roll’ is your roll
number.
c) Use indentation and comments as necessary. You are allowed to consult your books, notes or manual pages.
d) Upload the three files separately on Moodle.
PROBLEMS
Sample Output 2:
1. Evaluate a polynomial
2. Add two polynomials
3. Multiply two polynomials
What would you like to do? 3
2. Write a function merge() that takes two integer arrays A and B of sizes sizeA and sizeB as parameters,
Both the arrays A and B are assumed to be in sorted (increasing / non-decreasing) order. The function
merges the two arrays into a single sorted array C; the array C is allocated space dynamically inside the
function. The function returns a pointer to the first element of array C. The function prototype is as follows:
int *merge (int A[], int B[], int sizeA, int sizeB);
Write a main function that reads two sorted arrays, calls the function merge() to combine them into a
single sorted array , and print it. [30]