I'm getting the last number of a number , but have to convert last number to a string, as 14 ="Four" , 12 ="two"
using System;
namespace Program
{
class LastDigit
{
static void Main()
{
Console.WriteLine("Please write your number:");
long n = long.Parse(Console.ReadLine());
long lastDigit = n % (10); //or int or double - whatever numeral data type suits you
string word = "";
}
}
}
Except : 10 = "zero" , 14 = "Four"