1.

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

Answer»

Required Answer:-

Correct Cσde:

X = 10

Y = 20

if (X>Y):

   print(X+Y)

ELSE:

   print(X-Y)

To Find:

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.

•••♪



Discussion

No Comment Found