You have to process a mathematical expression and output the result. The expression contains three types of input: single digit number, plus sign (‘+’) and multiplication sign (‘*’). The precedence of ‘*’ is greater than ‘+’ as followed by any standard system. The expression ends with the minus sign (‘-‘) which will not be considered as the part of the expression but to mark the end of the expression. There must be at least one single digit number followed by the compulsory “-“ sign. You CANNOT use array for this.

Sample Input   Sample Output
1+2*2*3+5-          18

asked 05 May, 19:39

beginner%20level's gravatar image

beginner level
393

edited 06 May, 07:54

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
30618

Can you please provide the question link? Can't understand your problem for bad formatting.

NB: You shouldn't just ask for a homework / problem solution in the forum. These are for you to solve. You can ask for a specific problem if you are really stuck.

(06 May, 06:22) Ashfaqur Rahman
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×44

question asked: 05 May, 19:39

question was seen: 498 times

last updated: 06 May, 07:54