Question: Write a recursive method called evenDigits that accepts an integer parameter and that returns the integer formed by removing the odd digits from it. For
Write a recursive method called evenDigits that accepts an integer parameter and that returns the integer formed by removing the odd digits from it. For example, evenDigits(8342116) returns 8426 and evenDigits (-34512) returns -42. If the number is 0 or has no even digits, such as 35159 or 7, return 0. Leading zeros in the result should be ignored.
Step by Step Solution
3.46 Rating (169 Votes )
There are 3 Steps involved in it
public static int evenDigits int n ... View full answer
Get step-by-step solutions from verified subject matter experts
