From c7bbd76f4a6d4a75cdb30710ac513c006f68fac9 Mon Sep 17 00:00:00 2001 From: limitlesslogger Date: Sun, 15 Oct 2023 13:54:33 +0530 Subject: [PATCH] added polynomial representation and summation --- algorithms/polynomialsum.c | 85 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 algorithms/polynomialsum.c diff --git a/algorithms/polynomialsum.c b/algorithms/polynomialsum.c new file mode 100644 index 00000000..3a24927c --- /dev/null +++ b/algorithms/polynomialsum.c @@ -0,0 +1,85 @@ +/*Representation of polynomial and summation of two polynomials*/ +#include +typedef struct +{ + int exp; + float coeff; +}terms; +void inputPoly(terms a[],int n) +{ + printf("Please enter the input in descending order of degrees \n"); + for(int i=0;ib[j].exp) + { + c[k].exp=a[i].exp; + c[k].coeff=a[i].coeff; + i++;k++; + } + else if(a[i].exp