I have the following problem... i am trying to print out a table of values for the taylor expansion of exp() (as a function) and the plain value of exp().

(i) cant get function to work?

(ii) how might I combine their values on a table?

Many thanks!

include
Code:
#include <stdio.h>
#include <stdlib.h> 
#include <math.h> 



        double taylor(double x, int n)
    {
        int i;
        double sum = 1.0;
        double term= 1.0;
        for (i=1; i<=n; i++)
        {
        term = (term*x)/i;
        sum=sum+term;
        }          
        
        return sum;
        
        
     }