MSalmanHussain
MSalmanHussain MSalmanHussain
  • 25-12-2016
  • Computers and Technology
contestada

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)

Respuesta :

TheBlueLight
TheBlueLight TheBlueLight
  • 25-12-2016
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
Answer Link
rsmith6559
rsmith6559 rsmith6559
  • 26-12-2016
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.
Answer Link

Otras preguntas

four less than the product of a number and 7 is eight more than that number
If the sales tax is 3% what is the cost of a pair of shoes with a price of $55?
Derive the equation of the parabola with a focus at (−5, 5) and a directrix of y = -1 f(x) = −1/12 (x − 5)2 + 2 f(x) = 1/12 (x − 5)2 + 2 f(x) = −1/12 (x + 5)
what specific beliefs does each writer want his readers to hold
jewish & christian teaching helped contribute to the spread & development of.?
Suppose you wanted to do an experiment to find out if changing the length of a pendulum changed the amount of time it takes the pendulum to swing back and forth
mason sold 10 wristband and made a total of 5 dollars
Why was New Orleans “the one single spot” that made its possessor the “natural enemy” of the United States?
How do I solve #38?
evaluate u+ xy for u=9, x=9, y=7