164k views
0 votes
Input two numbers a and b. If a > b, then print the value of a - b; otherwise, print the value of b - a.

a) a > b
b) a - b
c) b > a
d) b - a

User WizLiz
by
7.6k points

1 Answer

6 votes

Final answer:

The question is about comparing two numbers and subtracting them based on whether one is greater than the other.

Step-by-step explanation:

Given two numbers, a and b, if a > b, then the value of a - b is printed. If a is not greater than b, then the value of b - a is printed. This can be represented as:

a) a > b

b) a - b

c) b > a

d) b - a

For example, if a = 5 and b = 3, a - b = 5 - 3 = 2. Therefore, the correct answer would be b) a - b.

User Blacktemplar
by
7.3k points