By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,412 Members | 1,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,412 IT Pros & Developers. It's quick & easy.

please help me to get the coding for this

P: 6
The value ex can be approximated by the sum
1 + x + x2/2! + x3/3! + + xn/n!
Write a program that takes a value x as input and outputs this sum for n taken
to be each of the values 1 to 100. The program should also output ex
calculated using the predefined function exp. The function exp is a predefined
function such that exp(x) returns an approximation to the value ex. The
function exp is in the library with the header file cmath. Your program should
repeat the calculation for new values of x until the user says she or he is
through.
Mar 14 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,510
The value ex can be approximated by the sum
1 + x + x2/2! + x3/3! + + xn/n!
Write a program that takes a value x as input and outputs this sum for n taken
to be each of the values 1 to 100. The program should also output ex
calculated using the predefined function exp. The function exp is a predefined
function such that exp(x) returns an approximation to the value ex. The
function exp is in the library with the header file cmath. Your program should
repeat the calculation for new values of x until the user says she or he is
through.
post what you have done so far with some indication of the problems you have and we can try to help.
Mar 14 '07 #2

DeMan
100+
P: 1,806
And please avoid double posting.....If you want to move your post back up the list, find it and post in it again (most of the other experts examine everything they haven't seen before even if it is 1.5 pages ago).

For those replying, the longer thread is here
Mar 14 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.