| 96 | } |
| 97 | |
| 98 | void printPoly(term *first){ //function to print the stored polynomial |
| 99 | char var = 'x'; |
| 100 | while(first!=NULL){ |
| 101 | cout <<first->coeff << var << "^" << first->pow << " "; |
| 102 | first = first->next; |
| 103 | if(!(first == NULL)) |
| 104 | cout << "+ "; |
| 105 | } |
| 106 | cout << endl; |
| 107 | } |
| 108 | }poly; //Data Structure (Linked List) based polynomial addition |
| 109 | |
| 110 | int main(){ |