fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main(void)
  4. {
  5. double e1, e2;
  6. double x;
  7. e1 = 1 + (x/1)+ pow(x,2)/(1.*2) + pow(x,3)/(1*2*3) + pow(x,4)/(1*2*3*4) + pow(x,5)/(1*2*3*4*5);
  8.  
  9. printf("%.5lf\n", e1);
  10.  
  11. e2 = exp(x);
  12. printf("%.5lf\n", e2);
  13.  
  14.  
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
1.00000
1.00000