KFerr1080
05-06-2003, 12:56 AM
I hae starte to write my program on how to calculate the derivative of a polyomial... I am confused as in how to do the calculation???? Also I was going to make function called der for a functin prototype......would that be right???? Any suggetions for me???? PLEASE!!!
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
#include <cmath>
int der( int ); //function prototype
int main()
{
int degree;
int coefficient;
int derivative;
degree = 0;
coefficient =0;
cout << "Enter the degree of the polynomial (or zero to quit): ";
cin >> degree;
if ( degree != 0 )
cout << "Enter the coefficients from highest degree to lowest degree: ";
cin >> coefficient;
if ( degree == 0 )
cout << "Thank you for playing! Please come again!";
derivative = degree * coefficient;
return 0;
} // end main
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
#include <cmath>
int der( int ); //function prototype
int main()
{
int degree;
int coefficient;
int derivative;
degree = 0;
coefficient =0;
cout << "Enter the degree of the polynomial (or zero to quit): ";
cin >> degree;
if ( degree != 0 )
cout << "Enter the coefficients from highest degree to lowest degree: ";
cin >> coefficient;
if ( degree == 0 )
cout << "Thank you for playing! Please come again!";
derivative = degree * coefficient;
return 0;
} // end main