/*PROGRAM T0 PRINT THE SUM OF SERIES:
1+x^2+x^4+x^6......nth term.*/
#include
#include
#include
void main()
{
int x,nterm,c,i,d=0;
clrscr();
printf("ENTER THE NUMBER X=");
scanf("%d",&x);
printf("\n\n\nENTER THE NTH TERM=");
scanf("%d",&nterm);
for(i=1;i<=nterm;i++)
{
c=pow(x,i*2);
d=d+c;
}
printf("\n\nSUM OF SERIES=%d",d+1);
printf("\n\n\n\nGOOD WORK!!!""\n\n\n""\"MR.ABHISHEK WADHWA\".KEEP IT UP!");
getch();
}
/******OUTPUT******
ENTER THE NUMBER X=2
ENTER THE NTH TERM=2
SUM OF SERIES=21
GOOD WORK!!!
"MR.ABHISHEK WADHWA".KEEP IT UP!
*/
No comments:
Post a Comment