#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int x,i;
double abc,sum=0;
printf("Enter a value for x:");
scanf("%d",&x);
for(i=0;i<=6;i++)
{
abc=pow(1/2,i)*pow((x-1)/x,i+1);
sum=sum+abc;
}
printf("Sum is %f\n",sum);
}
As what i have checked there is no overflow of values in data type either or is it something else?