10.8k views
4 votes
If x and y are positive integers is x - y always positive explain

User Sira Lam
by
5.5k points

2 Answers

3 votes

Answer:

No, if y happens to be a larger integer than x, then the result will be negative.

Explanation:

For example, lets say that x=4 and y=9, so x-y = 4-9 = -5.

But if we were to reverse it and make x=9 and y=4, then x-y = 9-4 = 5.

User Jhbruhn
by
5.7k points
4 votes

Note that x and y are nonzero integers. It means that x and y will always have same sign (both are either positive or negative, since they are nonzero). Hence, xy term is always positive.

User Laurentius
by
4.6k points