Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i;
- for (i = 10; i <= 35; i++) {
- String str = String.valueOf(i);
- int firstInt = Integer.parseInt(str.substring(0, 1));
- int secondInt = Integer.parseInt(str.substring(1, str.length()));
- String first = (firstInt % 2 == 0) ? "Even" : "Odd";
- String second = (secondInt % 2 == 0) ? "Even" : "Odd";
- print("Number is " + i + " and the first number " + firstInt + " is " + first + " and the second number " + secondInt + " is " + second);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement