Frage im Vorstellungsgespräch bei Flipkart

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