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

How are dobzhansky and mayr's ideas about the origin of species similar to darwin's?
The simplification of a rational multiplication or division problem is given. Each step is numbered under the problem in parenthesis - (1), (2), (3), and (4). I
can someone please help me with is ixl?.
What is the best estimate of the correlation coefficient for the variables in the scatter plot
Determine the empirical formula for the compound represented by each molecular formula. c2h4
propound on why a library is said to be the memory of the human race
Help me on this question
Which TWO of the following statements best express the central ideas of the text?
How did the morrill act of 1862 assist with education for blacks?
Why do we have a house and senate, anyway?