Answer:
This code or is program to find a given value of derivative of a polynomial.
Step-by-step explanation:
We know already how to apply or make the procedures mathematically talking so this short program will eventually help you how to find logic.
// libraries
#include <stdio.h>
#include <conio.h>
//use to control floating elements
float poly(float a[], int, float);
//main
int main()
{
// Enter the degree of polynomial equation
float x, a[10], y1;
int deg, i;
printf("Enter the degree of polynomial equation: ");
scanf("%d", °);
printf("Ehter the value of x for which the equation is to be evaluated: ");
// Enter the coefficient of x to the power
scanf("%f", &x);
for(i=0; i<=deg; i++)
{
printf("Enter the coefficient of x to the power %d: ",i);
scanf("%f",&a[i]);
}
// The value of polynomial equation for the value of x
y1 = poly(a, deg, x);
printf("The value of polynomial equation for the value of x = %.2f is: %.2f",x,y1);
return 0;
}
/* function for finding the value of polynomial at some value of x */
float poly(float a[], int deg, float x)
{
float p;
int i;
p = a[deg];
for(i=deg;i>=1;i--)
{
p = (a[i-1] + x*p);
}
return p;
}