How to convert hexadecimal to octal in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string hex = "0xFFFF";
        
        string oct = Convert.ToString(Convert.ToInt32(hex, 16), 8);

        Console.Write(oct);
    }
}




/*
run:

177777

*/

 



answered Jul 24, 2022 by avibootz

Related questions

1 answer 160 views
1 answer 171 views
1 answer 127 views
127 views asked Aug 25, 2021 by avibootz
2 answers 181 views
181 views asked Aug 25, 2021 by avibootz
1 answer 105 views
...