0% found this document useful (0 votes)
25 views1 page

We Use Cookies and Local Storage To Improve User Experience: I Understand

This document contains code to calculate the sum of an alternating series. It takes user input for the number of terms and the value of x. It initializes the sum and counter variables. It then uses a loop to alternately add and subtract terms of the form (x^i / i!) to the running sum, updating the counter i by 2 each iteration. Once i exceeds the number of terms, it prints the final sum.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

We Use Cookies and Local Storage To Improve User Experience: I Understand

This document contains code to calculate the sum of an alternating series. It takes user input for the number of terms and the value of x. It initializes the sum and counter variables. It then uses a loop to alternately add and subtract terms of the form (x^i / i!) to the running sum, updating the counter i by 2 each iteration. Once i exceeds the number of terms, it prints the final sum.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

long int fact(int n)

void main()

int n,x,i,k=1

oat sum=0

clrscr()

printf("Enter the term of series :")

scanf("%d",&n)

scanf("%d",&x)

i=1

i<=n

 False   True 

printf("sum of series = %f ",sum) sum=sum+(kpow(x,i)/fact(i))

getch() k=-k

long int fact(int n) i=i+2

int m

long int f=1

m=1

m<=n

 False   True 

f f=fm

m++

We use cookies and local storage to improve user experience I Understand ()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy