I am writing a program that lets the user input the power and the corresponding constant coefficients of a polynomial function, then the program should output the users mathematical function.
Enter the order of the polynomial: 2
Enter the coefficient of x^2: 1
Enter the coefficient of x^1: -5
Enter the constant term: 2
Your function is f(x) = x^2-5x+2
I have my code below but I encountered a small problem. There is still "+" that will come up after the constant term. And if possible, i want to ouput the function as what is shown above.(i,i., if the power is 1, just put 'x' and if the power is 0 just put the constant coefficient.