CBSE Class 11 Informatics Practices Question 35 of 75

Conditional and Looping Constructs — Question 7

Back to all questions
7
Question

Question 4(d)

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

num1 = '5' + '5'
print (num1)
Answer
Output
55
Explanation

The expression '5' + '5' performs string concatenation as they are enclosed in quotes. Therefore, '5' and '5' are concatenated to form the string '55', which is then assigned to num1. The print(num1) statement outputs the string '55'.