i want to evaluate polynomial using linked list

int polynomial:: evaluate_polynomial()
{
int input=0;
temp = NULL;
newnode = NULL;
//int newcoeff=0, newexpo = 0;
int evaluation_result = 0;
temp = head;
cout << "Enter value of X : " ;
cin >> input;
while (temp != NULL)
{
evaluation_result = evaluation_result + pow((coeff*input), expo);
//evaluation_result = (evaluation_result) + (temp->coeff) * (pow(input, expo));
temp = temp->next;
}
return evaluation_result;
}
in while statement there are two formula that click in my mind but both of them are not working correctly .... please help me to make formula for evaluation ....
Topic archived. No new replies allowed.