generate functionThu, 22 Dec 2022

write a function to receive a whole number and return the max digit

int maxDigit(int testnum) => testnum.ToString().Max(a => (int)char.GetNumericValue(a));

Questions about programming?Chat with your personal AI assistant