diff --git a/src/main/java/com/conversions/BinaryToGray.java b/src/main/java/com/conversions/BinaryToGray.java new file mode 100644 index 00000000..7b14c2a1 --- /dev/null +++ b/src/main/java/com/conversions/BinaryToGray.java @@ -0,0 +1,30 @@ +package src.main.java.com.conversions; + +public class BinaryToGray +{ + /* This method convert the binary number into gray code + @param binaryno need to convert binary number into gray code + @return graycode return as string + */ + + public String binaryToGray(String binarycode) + { + + String graycode=Character.toString(binarycode.charAt(0)); + + + for(int i=0;i