diff --git a/du3/program b/du3/program new file mode 100755 index 0000000..cc876d9 Binary files /dev/null and b/du3/program differ diff --git a/du3/program.c b/du3/program.c new file mode 100644 index 0000000..d801396 --- /dev/null +++ b/du3/program.c @@ -0,0 +1,32 @@ +#include +#include +#include + +int main() +{ + float a[100],sum=0,x; + int n,i; + + printf("\nEnter degree of the polynomial X :: "); + scanf("%d",&n); + printf("\nEnter coefficient's of the polynomial X :: \n"); + for(i=n;i>=0;i--) + { + printf("\nEnter Coefficient of [ X^%d ] :: ",i); + scanf("%f",&a[i]); + } + + printf("\nEnter the value of X :: "); + scanf("%f",&x); + + for(i=n;i>0;i--) + { + sum=(sum+a[i])*x; + } + + sum=sum+a[0]; + + printf("\nValue of the polynomial is = [ %f ]\n",sum); + + return 0; +} \ No newline at end of file