954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

User defined function, how to manipulate it?

Hello everyone! I need to ask the user for a function say: X^5 +7 and I need to ask him separately for the value of X, so I can calculate it then. I really don't know how to store the function and then manipulate it!
Thank you!

Dimitar
Newbie Poster
11 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

First step is to just write a program that asks you to enter a value, then use cin to get the value from the keyboard. Once you have that going (compiled without error and runs correctly) you can add the other stuff to it, whic to write a function that contains that formula and returns the result. The function needs one parameter -- the value of x.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Thanks!

Dimitar
Newbie Poster
11 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You