Things to note:The formula is pi r^2 h, the parentheses is used here to avoid the confusion. It is a good practise to use parentheses in a long expression, the expression becomes more understandable. According to hierarchy of operations, parentheses is evaluated first, if there are more than one set of parentheses, the innermost would be performed first, followed by the second innermost and so on.
stepwise evaluation of the expression is shown below.
c = 3.14*(5.0*5.0)*6.0
| Expression | operation | |
|---|
| c = 3.14*(25)*6.0 | ( * ) |
| c = 78.5*6.0 | * |
| c = 471.0 | * |
Powered by Open Source Programmers
|