Converting a decimal number to Gray code

Input:

Output:
(Binary)
(Gray code)