How to convert hexadecimal to decimal in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string hex = "FD";
        
        int dec = int.Parse(hex, System.Globalization.NumberStyles.HexNumber);

        Console.Write(dec);
    }
}



 
 
/*
run:
 
253
 
*/

 



answered Aug 25, 2021 by avibootz

Related questions

1 answer 113 views
113 views asked Aug 25, 2021 by avibootz
1 answer 81 views
1 answer 89 views
1 answer 90 views
1 answer 85 views
1 answer 89 views
2 answers 111 views
...