I tried to do codes to get e^x by using maclaurin series but it gives 0 .

558fe5180e0e8fc922d31c23ef84d240

#include <stdio.h>
#include <math.h>

int main()

float i, x;
double fact=0, sum=0;

printf("Enter value of x as the power of e: ");
scanf("%f", &x);

printf("Enter n as the number of terms:  ");
scanf("%d",&i);    

for (i = 0; i < 99999; i++)

{   
    sum = 1 + x;
    fact = fact * i;
    sum = sum + pow(x, i)/(fact);   
}
if (sum == sum)

printf("The value of e^%f is %lf",x,sum);

return 0;