MCQ Answer

Which of the following programs correctly prints the sum of two numbers?

Which of the following programs correctly prints the sum of two numbers?

निम्न में से कौन-सा program दो numbers का sum सही तरीके से print करता है?
Topic : Operators Expressions and Python Statements

A. print(input() + input())

B. print(int(input()) + int(input()))

C. print(input + input)

D. print(eval(input))




Correct Answer is :

B. print(int(input()) + int(input()))



Explanation
input() returns strings, so int() converts both inputs to integers before addition.

input() string return करता है, इसलिए addition से पहले दोनों values को int() में convert करना आवश्यक है।
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad