Test Index

CBSE Class 12 Computer Science 2025 Paper Set 4 Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 2 of 37
Marks: +1, -0
What will be the output of the following statement ?
print(14%3**2*4)
Solution:  
Concept:
Operator precedence in Python: ** (exponent) is evaluated first, and it binds tighter than *, /, //, %. The operators * and % have the same precedence and are evaluated from left to right.
Explanation:
Step 1: 3**2 = 9, so the expression becomes 14%9*4
Step 2: 14%9 = 5 (left to right)
Step 3: 5*4 = 20
Output:
20
Key point: Doing 9*4 first would give 14%36 = 14, which is not an option; % and * are applied left to right.
Answer:
Option C (20)
© examsnet.com
Advertisements
Go to Question: