Question #301126

you are given two integers, a and b. print the smallest value among a%b and b%a.


Expert's answer

a = 1234
b = 678

x = a%b if a%b < b%a else b%a

print('a =', a, 'b =', b)
print('Smallest value among a%b and b%a is', x)
LATEST TUTORIALS
APPROVED BY CLIENTS