a=40,b=35,c =20 d=10
output of following statement
Print a*b / c-d
Printf
a*b /(c-d)
Ane: differ by 80
Answers
Answered by
2
Answer:
140
Explanation:
a*b/c-d
=40*35/20-10
=1400/10
=140
(answer)
Answered by
2
Concept:
The order in which terms in an expression are grouped and evaluated is determined by the operator precedence. Certain operators are given preference above others.
Given:
a=40
b=35
c =20
d=10
print(a*b / c-d)
print(a*b /(c-d))
Find:
Find the output.
Solution:
Python also uses a similar type of BODMAS rule known as PEMDAS.
P – Parentheses
E – Exponentiation
M – Multiplication
D – Division
A – Addition
S – Subtraction
In the first expression,
According to precendence the evaluation will be in the following manner:
In the second expression,
According to precendence the evaluation will be in the following manner:
The difference in outputs:
Similar questions