MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
output of following code?
A
4.5
B
4.0
C
4
D
error
Explanation: 

Detailed explanation-1: -The answer is 34 (as an integer), first when you add strings they are concatenated so “3” + “4” would give the string “34” then the int() function would change that string into an integer.

Detailed explanation-2: -So, int("3” + “4") = int("34") = 34. x=int("3")+int("4") print(x) then output is 7.

Detailed explanation-3: -output is just what happens onces all the code is done, the end result. after all the calculation are done its what get put into the console. basically its what gets put out.

Detailed explanation-4: -Print((4+8) /2) the output is 6.0. In Python, the “/” stands for floating point division, as opposed to the “//", which stands for integer division. whenever the division operator is calculated the result by default is in float form.

There is 1 question to complete.