CBSE Class 11 Computer Science Question 49 of 80

Conditional and Looping Constructs — Question 19

Back to all questions
19
Question

Question 10(e)

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

print(4.00 / (2.0+2.0))
Answer
Output
1.0
Explanation

1. Evaluate the expression inside the parentheses first:

2.0 + 2.0

This calculation is straightforward:

2.0 + 2.0 = 4.0

2. Perform the division operation:

4.00 / 4.0 = 1.0

3. Print the result:

print(1.0)

Therefore, the output of the given code snippet is:

1.0