Code Snippets C

#include
int main()
{
double data[100];
double sum = 0.0;
int j = 0;
double sign = 1.0;
printf("\nYou entered the values:\n");
for(j = 1 ; j<=100 ; j++){
data[j-1] = 1.0/(2*j*(2*j+1)*(2*j+2));
}
for(j = 0 ; j<100 ; j++)
{
sum += sign*data[j];
sign = -sign;
}
printf("\nResult is %.4lf\n", 4.0*sum+3);
}