integer x = 0, y = X--|--X
if(x = y)
print x + y
else if (y=x)
print x-y
else
print (2*x + y)
Answers
Answered by
9
Answer:
2
Explanation:
Answered by
0
The output of the above program would be -1
After processing the data through this program it will read as
(2*0)+(-1) = -1
The given program is based on if else statement
By given
x = 0
y = X--|--X
- If the output is true for this condition (x = y)
(x = y) (x = y)
(0 = 0-1-0)
(0 = 1)
Then it will execute the output as x + y (0 + 1)
- If the output is false for this condition (x = y)
Then the next condition will be applied (y=x)
(0-1-0 = 0)
(1 = 0)
Then it will execute the output as x - y(0 - 1)
- Even if this statement is false
Then the output will be executed as (2*0)+(-1) = -1
Hence the output is
(2*0)+(-1) = -1
=-1
Similar questions