CBSE Class 11 Informatics Practices
Question 52 of 75
Conditional and Looping Constructs — Question 24
Back to all questionsok
average
if x > 10:- The condition checks if
xis greater than 10. - Since
x = 50, which is greater than 10, this condition is true.
- The condition checks if
Nested
if x > 25:- Since the outer condition is true, the program proceeds to this nested condition, which checks if
xis greater than 25. - Since
x = 50, which is greater than 25, this condition is also true. - Consequently, it prints
ok
- Since the outer condition is true, the program proceeds to this nested condition, which checks if
Nested
if x > 60:- After printing 'ok', the program checks this nested condition, which verifies if
xis greater than 60. - Since
x = 50, which is not greater than 60, this condition is false. - Therefore, the program proceeds to the
elifpart.
- After printing 'ok', the program checks this nested condition, which verifies if
Nested
elif x > 40:- This condition checks if
xis greater than 40. - Since
x = 50, which is greater than 40, this condition is true. - Consequently, it prints
average
- This condition checks if
The
elseblock- The
elseblock is not executed because theelif x > 40:condition was true.
- The