while (true)
{
Console.Write(“please enter a letter to Know The ascii Code : “);
var num = Console.ReadLine();
int intNum= int.Parse(num);
if (num != "exit")
{
Console.WriteLine($"{intNum}={(int)intNum}");
}
else
{
break;
}
}
this code is for ask the user for write a number and the output is the ascii value
New contributor
Ahmed Abo Elata is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.