Computer Science, asked by muskant001, 3 months ago


X =10
Y=20
if (X>Y)
print X+Y
else
print X-Y​

Answers

Answered by anindyaadhikari13
1

Required Answer:-

Correct Cσde:

X = 10

Y = 20

if (X>Y):

   print(X+Y)

else:

   print(X-Y)

To Find:

  • Output (Python)

Output:

>> -10

Explanation:

  • Here, X = 10 and Y = 20.
  • Therefore, X>Y is false as 10>20 is false.
  • So, the if-block will not execute. Thus, the else block will execute.
  • So, it prints the value of X-Y which is equal to 10 - 20 or -10.
  • So, the output is -10.

Refer to the attachment for output.

•••♪

Attachments:
Similar questions