Question: Write a method called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the number consists entirely of odd
Write a method called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the number consists entirely of odd digits (1, 3, 5, 7, 9) and false if any of its digits are even (0, 2, 4, 6, 8). For example, the call allDigitsOdd(135319) returns true but allDigitsOdd(9145293) returns false.
Step by Step Solution
3.49 Rating (175 Votes )
There are 3 Steps involved in it
public static boolean allDigits... View full answer
Get step-by-step solutions from verified subject matter experts
