Computer Science, asked by changwook253, 5 months ago

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 devishankarparida
2

Answer:

140

Explanation:

a*b/c-d

=40*35/20-10

=1400/10

=140

(answer)

Answered by varshamittal029
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, a*b / c-d

According to precendence the evaluation will be in the following manner:

=40*35/20-10\\=1400/20-10\\=70-60\\=60

In the second expression, a*b / (c-d)

According to precendence the evaluation will be in the following manner:

=40*35/(20-10)\\=40*35/10\\=1400/10\\=140

The difference in outputs: 140-60=80

Similar questions