fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int n = 16;
  8. Console.Write("0x{0:x2} 0x{1:x2}", (n & 0xff00) >> 8, n & 0xff);
  9. byte lowByte = (byte)(n & 0xff);
  10. byte highByte = (byte)(n >> 8 & 0xff);
  11. Console.Write(lowByte);
  12. Console.Write(", ");
  13. Console.Write(highByte);
  14. }
  15. }
Success #stdin #stdout 0.03s 26068KB
stdin
Standard input is empty
stdout
0x00 0x1016, 0