TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
bn9
NA
24
0
the value of e
Feb 29 2004 9:03 PM
i am trying to write a program that output the value of e (exponential) using an infintie series. with e^(x) and you set x equal to 1 you can find the value of e. the program uses 20 terms. i have everthing in the program ok, but i cant figure out how to set the equation in the program. can someone PLEASE help?? thank you int n ; // set double integers. e which is constant // y, for the value of the equation, and x // for the difference from e and y double e, y, x; // Display column titles Console.WriteLine("Terms e error"); // begin number of terms at one n=1; //set e to constant value e=2.718281828459045; // forever loop while n is between 1 and 20 for(n=1; n<=20; n++) { ------------------>>>>>>>>>>>>THIS IS THE POINT OF CONFUSION!!?!! y = ?????????? // y equals e^(x) in infinite series equation // set difference in equation from actual value of e // known as 'error' in the program x = e-y; // Display values in the 3 columns Console.WriteLine("{0} {1} {2}", n, y, x); // increment n
Reply
Answers (
2
)
C# InvalidActiveXStateException
Syntax for referring to variable name by string?