Polynomials like 5x^{4} + 2x^{3} + 7x^{2 } + 10x - 8 can be represented by using arrays. Arithmetic operations such as addition & multiplication of polynomials are common and most often; we have to write down a program to implement these operations.
The easiest way to represent polynomial of degree 'n' is to store up the coefficient of (n+1) terms of the polynomial in an array. To gain this, each of the elements of the array must contain two values, namely, exponent and coefficient. Whereas maintaining the polynomial, it is supposed that the exponent of each of the successive term is less than that of the earlier term. Once we create an array to represent a polynomial, we can employ such an array to perform common polynomial operations such as addition & multiplication.
Program 2 accepts 2 polynomials as input & adds them.