Find the remainder without modulus

Find the remainder without modulus

Write an application that prompts for and reads 2 integers a and b, then prints a mod b without using the modulus (%) operator.

Example 1:


input data:
23 5
output:
3

Example 2:


input data:
17 5
output:
2
View Java Solution

Seda
Seda Kunda is a web designer and developer with a degree in Computer Science and a great passion for code. Besides code, she enjoys pepperoni pizza, watching the bachelor and sleeping in on Saturdays.
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn