C, pasted on Sep 14:
 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ``` ```#include #include #include #define eps 1e-4 // Sai sá»‘ int main() { float S, T, x, LuyThua, GiaiThua; int i, Dau = -1; printf("\nNhap x(radian): "); scanf("%f", &x); GiaiThua = 1; S = T = LuyThua = x; for(i = 3; T > eps; i += 2, Dau = -Dau) { T = (LuyThua *= x * x) / (GiaiThua *= i * (i - 1)); S += Dau * T; } printf("\nCong thuc Taylor: sin (%.2f) = %.4f", x, S); printf("\nSin () cua math.h: sin(%.2f) = %.4f", x, sin(x)); getch(); return 0; } ```

Output:
 ```1 ``` ```Line 17: error: conio.h: No such file or directory ```

#include <iostream>
#include <math.h>
using namespace std;

int main() {
int i, j, n, fact, sign = -1;
float x, p, sum = 0;

printf("Enter the value of x: ");
scanf("%f", &x);
printf("Enter the value of n: ");
scanf("%d", &n);

for (i = 1; i <= n; i += 2){
p = 1;
fact = 1;
for ( j = 1; j <= i; j++){
p = p * x;
fact = fact * j;
}
sign = -1 * sign;
sum += sign * p / fact;
}

printf("sin %0.2f = %f", x, sum);
return 0;
}