CBSE Class 11 Informatics Practices Question 33 of 75

Conditional and Looping Constructs — Question 5

Back to all questions
5
Question

Question 4(b)

Give the output of the following when num1 = 4, num2 = 3, num3 = 2.

num1 = num1 ** (num2 + num3)
print (num1)
Answer
Output
1024
Explanation

In the given code, num1 = num1 ** (num2 + num3) calculates the result of raising num1 to the power of the sum of num2 and num3. The expression becomes 4 ** (3 + 2), which simplifies to 4 ** 5. Evaluating 4 ** 5 results in 1024, so the output of print(num1) is 1024.