Pregunta de entrevista de Flipkart

GIven a binary number, write a code to convert it into gray code.