Program that returns digits whose name is shorter than their value. public void DNF()
{
string[] digitDNF = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
var shortDNF = digitDNF.Where((digit, index) => digit.Length < index);
Console.WriteLine("Short DNF digits:");
foreach (var x in shortDNF )
{
Console.WriteLine("The word {0} is shorter than its value.", x);
}
}
Thanks
Amatya