Question: C-Programming Evaluate an expression from console input and print its result. The format of expressions: Number Symbol Number Symbol Symbol Number = Number refers to

C-Programming

Evaluate an expression from console input and print its result. The format of expressions: Number Symbol Number Symbol Symbol Number = Number refers to an integer and Symbol refers to only either + or -. E.g., given input 1 + 2 3 + 4 =, the result should be 4. If the user only uses the "+" sign then 1+2+3+4 should be 10. If the user only uses the "-" sign then 1-2-3-4 should be -8. No other signs like / and * are allowed, anytime user inputs a sign apart from + or - the output should be = invalid symbols used

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!