Convert Decimal Number to BinaryOctal and Hexadecimal Format

suggest change
  1. To convert decimal number to binary format use base 2
    Int32 Number = 15;
    Console.WriteLine(Convert.ToString(Number, 2));  //OUTPUT : 1111
  2. To convert decimal number to octal format use base 8
    int Number = 15;
    Console.WriteLine(Convert.ToString(Number, 8));  //OUTPUT : 17
  3. To convert decimal number to hexadecimal format use base 16
    var Number = 15;
    Console.WriteLine(Convert.ToString(Number, 16));  //OUTPUT : f

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents