adding c version
Adding java version