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 166 views
1 answer 184 views
1 answer 143 views
143 views asked Aug 25, 2021 by avibootz
2 answers 196 views
196 views asked Aug 25, 2021 by avibootz
1 answer 122 views
...