212k views
5 votes
a. Given a = 13 and b = 195, find b div a and b mod a. b. Given a = 24 and b = 377, find b div a and b mod a.

User Roco CTZ
by
5.4k points

1 Answer

2 votes

Answer:

A. 15 and 0. B. 15 and 17

Explanation:

A. a= 13 and b = 195.

b div a = 195 div 13. The result is the integer part of the division, so

195 div 13 = 15.

b mod a = 195 mod 13. The result is the residue of the division. In this case the division is exact, so

195 mod 13 = 0.

B. a = 24 and b=377.

b div a = 377 div 24. The result is the integer part of the division, so

377 div 24 = 15.

b mod a = 377 mod 24. The result is the residue of the division. In this case the division is not exact, so

377 = 24*15+17, then

377 mod 24 = 17.

User Incpetor
by
5.1k points