Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Ex11 {
- public static void main(String[] args) {
- int number = 12345;
- int firstDigit = number / 10000;
- int secondDigit = (number / 1000) - 10;
- int thirdDigit = (number / 100) - 120;
- int forthDigit = (number / 10) - 1230;
- int fifthDigit = number - 12340;
- System.out.println(firstDigit + " " + secondDigit + " " + thirdDigit + " " + forthDigit + " " + fifthDigit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement