How to convert decimal to hexadecimal in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        int dec = 253;
        
        string hex = dec.ToString("X");

        Console.Write(hex);
    }
}



 
 
/*
run:
 
FD
 
*/

 



answered Aug 25, 2021 by avibootz

Related questions

1 answer 137 views
137 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
...