New problem. I get the following when trying to compile:
in function 'int main()'
'cout' undeclared (first use this function)
(Each undeclared idnetifier is reported only once for each function it appears in.)
'cin' undeclared (first use this function)
In function 'USHORT der(USHORT,USHO RT,USHORT,USHOR T)'
'(((int)coeffic ient)*((int)y)) ' cannot be used as a function
My code (i changed it a bit) is:
NOTE: I have not edited the indentation yet, sorry for that.
in function 'int main()'
'cout' undeclared (first use this function)
(Each undeclared idnetifier is reported only once for each function it appears in.)
'cin' undeclared (first use this function)
In function 'USHORT der(USHORT,USHO RT,USHORT,USHOR T)'
'(((int)coeffic ient)*((int)y)) ' cannot be used as a function
My code (i changed it a bit) is:
Code:
typedef unsigned short USHORT; #include <iostream> #include <cmath> USHORT der(USHORT coefficient, USHORT xInteger, USHORT y, USHORT z); int main() { USHORT coefficient; USHORT y; USHORT xInteger; USHORT z; USHORT derivative; cout << "\nCoefficient of 'X'? "; cin >> coefficient; cout << "\nPlease enter Exponent? "; cin >> y; cout << "\nPlease enter x. "; cin >> xInteger; cout << "\nPlease enter Exponent again? "; cin >> z; derivative= der(coefficient,xInteger,y,z); cout << "\nYour Derivative is "; cout << derivative; cout << " Thanks for using this program, hope it helped :)\n\n"; return 0; } USHORT der(USHORT coefficient, USHORT xInteger, USHORT y, USHORT z) { return pow((( coefficient * y ) ( xInteger )) , ( z - 1 )); }
Comment