Remainder Challenge (Solution in 4 Languages)

Here is my solution to the challenge from the lesson on remainders. I like to challenge myself to solve these in every programming language I know. All solutions assume the modern LTS version of the languages is being used.

Solution in C (Includes <stdlib.h>):

Solution in C++:

Solution in Rust (Requires rand crate version 0.10.0-rc.6):

Solution in Java: