hello i have a question .how can i write a program that gets a statement from user & prints the result sth like below:
2*3+sin(1-cos(0))
please help me
sa-al 0 Newbie Poster
Recommended Answers
Jump to PostThere is no way (at least in C and C++) you can input a mathematical expression in the form of mathematical expression. You can only input a string and convert it to mathematical expression and do the calculation.
No easy to do that.
Jump to PostTo give you some idea, I've decided to write a simple code to calculate the simple mathematic expression. It supports only a very basic math operator such as +, -, *, and /. It doesn't support (...) yet. I will try add (...) feature into this tomorrow, if I have …
All 7 Replies
Aia 1,977 Nearly a Posting Maven
sa-al 0 Newbie Poster
dubeyprateek 26 Junior Poster
invisal 381 Search and Destroy
invisal 381 Search and Destroy
kv79 -1 Posting Whiz in Training
ssharish2005 62 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.