Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Q2 {
- public static void main(String[] args) {
- System.out.println(secret1(937, 5));
- }
- public static boolean secret1(int num, int digit) {
- if(num<10)
- return (num%2 == digit%2);
- if(num%2 != digit%2)
- return false;
- return secret1(num/10, digit);
- }
- }
Add Comment
Please, Sign In to add comment