answersLogoWhite

0

#include

#include

struct polynode

{

float coeff;

int exp;

struct polynode *link;

};

void poly_append(struct polynode **,float,int);

void display_poly(struct polynode *);

void poly_multiply(struct polynode *, struct polynode *, struct polynode **);

void padd(float, int, struct polynode **);

main()

{

struct polynode *first, *second, *mult;

int i,coeff,exp,high;

first = second = mult = NULL;

printf("Enter the highest power of polynomial 1: \n");

scanf("%d",&high);

for(i=high;i>0;i--)

{

printf("Enter value for coeff for X^%d : ",i);

scanf("%d",&coeff);

poly_append(&first, coeff,i);

}

printf("\nEnter the highest power of polynomial 2: \n");

scanf("%d",&high);

for(i=high;i>0;i--)

{

printf("Enter value for coeff for X^%d : ",i);

scanf("%d",&coeff);

poly_append(&second, coeff,i);

}

printf("\n\n");

display_poly(&first);

printf("\n");

display_poly(second);

printf("\n");

for(i=1;i<=79;i++)

printf("-");

poly_multiply(first, second, &mult);

printf("\n");

display_poly(mult);

}

/* adds a term to a polynomial */

poly_append(struct polynode **q, float x, int y)

{

struct polynode *temp;

temp = *q;

/* create a new node if the list is empty */

if(*q NULL ) )

{

r = malloc ( sizeof ( struct polynode ) );

r -> coeff = c;

r -> exp = e;

r -> link = temp -> link;

temp -> link = r;

return;

}

temp = temp -> link; /* go to next node */

}

r -> link = NULL;

temp -> link = r;

}

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Programfor addition of two polynomial using circular link list?

dsd


Write a c program add two polynomial using link list?

GOUDHMARINI


Give an example of a polynomial?

6x+5b+3, see related link for a thorough explanation of what a polynomial is.


What is the multiplication table?

This link gives you an excellent multiplication table and some tips.Please see related link below.


A brief introduction of polynomial?

The link to the left will give you the basics.


Using ANSI in C language?

The latest ANSI standard is C99. See the attached link.


What math website is there to get a multiplication chart?

See the Related Links section below for a link to a site with a good multiplication chart.


What is a link language?

Link language is just simple a language. With the help of link language we can make our contacts to others.Hindi for Indians, Japan i for Japanese Chinese for citizens of China are the link language . Except these there are some vernacular languages also serves as link language in particular countries. but which language should be accepted as International link language is still a matter of controversy.


How do you read the word on the rock where you get the regis?

The language on the rock is Braille. To read it I suggest using the related link below.


Where can I find multiplication facts worksheets?

Yes, i can point you in the right direction. please follow this link so you can find some multiplication facts worksheets sheets: math.about.com/cs/multiplication/a/multws.htm


Where are the math worksheets, related to multiplication?

The following link shall bring you to a website which specializes in math worksheets related to multiplication. They are used in schools and at home and can be printed off free of charge. Here is the link: http://www.tlsbooks.com/mathworksheets.htm


What is the partial-product method for 6225?

The partial products method is a method for performing multiplication problems. An actual multiplication problem is necessary to demonstrate. See related link.