#include<stdio.h> int main(void) { int denominator,i,n; double item,sum,flag; flag=1; denominator=1; sum=0; printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n;i++){ item=(flag*i)/denominator; sum=sum+item; flag=-flag; denominator=denominator+2; } printf("sum=%.2f ",sum); return 0; }