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 PostI am not quite sure I am understanding what you want in its totality. However it should be in these lines:
Use fgets() to obtain pertinent information from user.
Do calculation with the information.
Store calculation in variable
display the value in variable.What's sth? What do you …
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.
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.