#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int ct, ft;
float sum=0, x, power, fact;
clrscr();
printf("--------PROGRAM FOR SUM OF EQ. SERIES------");
printf("\n\nEnter the value of X : ");
scanf( "%f", &x);
ct=0;
for(power=0; power<=10; power=power+2)
{
fact=1; for(ft=power; ft>=1; ft--)
fact =fact* ft;
sum=sum+(pow(-1,ct)*(pow(x,power)/fact)); //EQ. FOR SUM SERIES
ct++;
}
printf("\n Sum : %f",sum);
getch();
}
#include<conio.h>
#include<math.h>
void main()
{
int ct, ft;
float sum=0, x, power, fact;
clrscr();
printf("--------PROGRAM FOR SUM OF EQ. SERIES------");
printf("\n\nEnter the value of X : ");
scanf( "%f", &x);
ct=0;
for(power=0; power<=10; power=power+2)
{
fact=1; for(ft=power; ft>=1; ft--)
fact =fact* ft;
sum=sum+(pow(-1,ct)*(pow(x,power)/fact)); //EQ. FOR SUM SERIES
ct++;
}
printf("\n Sum : %f",sum);
getch();
}
thanx dude...
ReplyDeletethanks
ReplyDelete