109k views
1 vote
How do you Evaluate an equation doing dry run ? In C++ language whats the order for using the operators like +, -, /, * ? For Example (2-5+10*3/4)

User Tardyp
by
7.0k points

2 Answers

0 votes
In most program languages, operator precedence is algebraic. Exponents, multiplication/division, addition/subtraction and I believe all the comparison operations are lowest. The search term would be "operator precedence".

Operators of equal precedence are evaluated left to right.
User Mohammed Essehemy
by
8.0k points
4 votes
just as math in, -3+30/4 the variable u use tells the recision
for int it would be
5 wich is wrong (4.5 is the answer)
so u include iostream
create main function , declare the variables and write the equation
User Mjbsgll
by
7.3k points