Hi,
Here i am giving the sample which will give you required result...
Sincere advise don't look for solution from others without initial effort.
int main()
{
double sum=0,fraction;
int num;
printf("Enter the Sequence length\n");
scanf_s("%d",&num);
for(int i=1;i<=num;i++)
{
if(i%2==0)
{
fraction = -(float)1/i;
}
else
fraction = (float)1/i;
sum = sum + fraction;
}
printf("The result of the sequence is %f",sum);
return 0;
}