An integercannothave characters. What do you want ? You want to find if a certain digit is in a certain number ?Code:// 1 means found // 0 means not found // -1 means error int search_digit(int num, int digit) { if(num == 0 && digit == 0) return 1; if(digit >= 10 || digit < 0) return -1; while(num > 0) { if((num % 10) == digit) return 1; else num /= 10; } return 0; }