Home
Questions
Search
Forum
Contact
Guest Book
Polls!
Got a Question?
 
PREV
Programs
NEXT
 
(61 / 301)
 
 



Wite code to evaluate a polynomial.





typedef struct node
{
  float cf;
  float px;
  float py;
  struct node *next;
}mynode;



float evaluate(mynode *head)
{
   float x,y,sum;
   sum = 0;
   mynode *poly;

   for(poly = head->next; poly != head; poly = poly->next)
   {
     sum = sum + poly->cf * pow(x, poly->px) * pow(y, poly->py);
   }

   return(sum);
}



PREV
COMMENTS                                  INDEX                                  PRINT
NEXT



Last updated: November 3, 2005

www.cracktheinterview.com - Your destination for the most common IT interview questions, answers, frequently asked interview questions (FAQ), C Programs, C Datastructures for technical interviews conducted by the top IT companies around the world!