Polynomial Code
Polynomial Code
h>
#include <stdlib.h>
struct Term
{
int coefficient;
int exponent;
};
struct Polynomial
{
int numTerms;
struct Term *terms;
};
void createPolynomial(struct Polynomial *poly)
{
int i;
printf("Enter the number of terms: ");
scanf("%d", &poly->numTerms);
poly->terms = (struct Term *)malloc(poly->numTerms * sizeof(struct Term));