Question 24
What will be the output of the expression-print("50" + 70)
0 50 70
7050
© 5070
Answers
Answered by
1
Answer:
Error
Explanation:
Here 50 is a string and 70 is an integer, so it cannot concatenate a string and an integer.
Answered by
6
The output of the expression-print("50" + 70) will give an error.
The error occurs because of the following reason:
- "50" is a string, 70 is an integer.
- We cannot add a string with an integer.
- In programming languages like python, there is a limitation. We can only concatenate if the given program would be:
print("50"+"70")
Output: 5070
- The program would also work if it would be:
print(50+70)
Output: 120
Similar questions