generate functionThu, 22 Dec 2022

write a function to receive a whole number and a single digit and return true if the digit exists in the number do not use string

public static bool Exists(int number, int digit) { while (number > 0) { if (number % 10 == digit) { return true; } number = number / 10; } return false; }

Questions about programming?Chat with your personal AI assistant