using System;
public class AsciiToHex_CSharp
{
public static void Main(string[] args)
{
char asciiChar = 'A';
int asciiValue = (int) asciiChar; // Convert to ASCII value
string hexValue = asciiValue.ToString("x"); // Convert to hex
Console.WriteLine("The hexadecimal value of '" + asciiChar + "' is: 0x" + hexValue);
}
}
/*
run:
The hexadecimal value of 'A' is: 0x41
*/