#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
int i,n,sum=1,sine=-1;
printf("\n enter any integer:");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
sum=sum+(i*sine);
sine=sine*(-1);
}
printf("\n series is %d",sum);
getch();
return 0;
}
0 comments:
Post a Comment