Console.WriteLine as hexadecimal

c#, hex

Solution

Console.WriteLine ("Hex: {0:X}", nNum);

The X formatter outputs uppercase hex chars. Use a lowercase x for lowercase hex chars.

Problem

The following code prints out `10`. How can I make it print out `a`? ``` int i = 10; Console.WriteLine("{0}", i); ```

Original source