Given two numbers X and Y. Write a program to determine the difference between X and Y. If X – Y is negative, compute R = X + Y; if X – Y is zero, compute R = 2X + 2Y; and if X – Y is positive, compute R = X*Y. Print out the value of X, Y, and R.
Start
Declare variables X,Y,D,R
D = X – Y
if D<0 then
R = X + Y
End if
if D=0 then
R = 2*X + 2*Y
end if
if D>0 then
R = X*Y
end if
Print X
Print Y
Print R
Stop
Comments
Leave a comment