Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The assignment is Write a program that asks the user to enter an integer x value

ID: 3648871 • Letter: T

Question

The assignment is Write a program that asks the user to enter an integer x value for and then calculate the value for the following polynomial: x^5-5x^4+10x^3-10x^2+5x+1.
This is my program and it is not working, but I am not sure why. Help Please!
#include <stdio.h>
#include <math.h>

int main(void)
{
int x;

printf ( "Please input an interger value for x: ");
scanf ( "%d", &x);
polynomial = pow (x,5) - 5 pow (x,4) + 10 pow (x,3) - 10 pow (x,2) + 5 pow(x,1) + 1

printf ( "The value for the polynomial of x = %d is: %d ", x, polynomial);

return 0;
}

Explanation / Answer

please rate - thanks

polynomial is not declared, ; is missing, and you must explicity have every arithmetic operator, you were missing the astericks for multiplication

#include <stdio.h>
#include <math.h>

int main(void)
{
int x,polynomial;

printf ( "Please input an integer value for x: ");
scanf ( "%d", &x);
polynomial = pow (x,5) - 5*pow (x,4) + 10*pow (x,3) - 10*pow (x,2) + 5*pow(x,1) + 1;

printf ( "The value for the polynomial of x = %d is: %d ", x, polynomial);

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote