#include
using namespace std;
Double fac (int num1) {
Int resualt1=1;
While (num1 & gt;
=1){
Resualt1 *=num1;
Num1 -;
}
Return resualt1;
}
Double power (int num2, int num3) {
Int resualt2=1;
While (num3 & gt;
=1){
Resualt2 *=num2;
Num3 -;
}
Return resualt2;
}
Double sin1 (double x) {
Double SQR=x * x;
Double e=x;
Double r=0;
int i=1;
While (I & lt; 13)={
Double f=e/fac (I);
R=(I % 4==1)? R + f: r - f;
E=e * SQR.
I +=2;
}
return r;
}
Int main () {
Cout & lt; & lt; Sin1 (5) & lt; & lt; Endl;
return 0;
} CodePudding user response:
Factorial function double fac (int num1), int resualt1=1; Data type is wrong, the result error is a bit, for reference: # include & lt; Iostream>
#include
CodePudding user response: