Python Programming - Operators - Discussion
Discussion Forum : Operators - General Questions (Q.No. 12)
12.
What is the output of the following code?
a = 5
b = 3
c = 7
print(a + b * c)
Answer: Option
Explanation:
The multiplication operator has higher precedence than the addition operator, so
b * c
is evaluated first and then added to a
.
a + b * c
= 5 + 3 * 7
= 5 + 21
= 26
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers