functional programming – How to write a C program to print Pi basing on Madhava series

in this question, i have been tasked to write a program that prints pi basing on madava series, using pi() function and power() function.
This is the series i have been told to use
The issue is that, when i use power(), i dont get the actual value of pi.
This is the source code i have written.

double pi();
int power(int x, int y);
int n;
int main()
    double ret;
double pi()
    double j, result;
    int x, k, n;
    printf("Input value of n:");
    for( k=0; k<n; k++ )
    result+=(power((-1),(k))/ power((2*k+1.3),k)) ;
    return j;
int power(int x, int y)
    int res = 1;
    for( y; y>0; y--)
        res = res*x;
    return res;