You are here:

C++/C++ formula problem


I am using Microsoft Visual C++ 6.0. I am trying to figure out how to write a program that computes the value of e^x by using the formula: e^x=1+(x/1!)+(x^2/2!)+(x^3/3!)+...with x being input by the user. I cant figure out how to even start it. I have been picking at it for the past day. If you could help it would be much appreciated. Thank You!

Austin , Thank you for your question.

Is this homework?

It is against my policy to do homework questions. I can help you with work that you have already done, but I cannot give you full answers.

Learning can be difficult, but doing your own work will repay your effort with good grades in school and success in your career.

You need to write a loop that adds each term to a variable that will contain the value of e^x. It may help to think it through and write down a workable design on paper, then write a program for your design.

Please attempt to do part of the work, and then ask a specific question when you get stuck.

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2017 All rights reserved.