VILL- DEBANDI, AMTA, HOWRAH PIN-711410 Phone-9836357266
#include <stdio.h>
int main()
{
int n;
int sum=0,i;
printf("Enter the range of number:");
scanf("%d",&n);
for(i=1;i<=n;i++)
if(i%2==0)
sum-=i;
else
sum+=i;
}
printf("The sum of the series = %d",sum);
return 0;
No comments:
Post a Comment