Answers for "print digits in java"

0

how to extract digits from a number in java

// Java program to Extract Digits from A Given Integer
        // Printing the last digit of the number
        while (number > 0) {
            // Finding the remainder (Last Digit)
            int remainder = number % 10;
            // Printing the remainder/current last digit
            System.out.println(remainder);
            // Removing the last digit/current last digit
            number = number / 10;
        }
Posted by: Guest on January-31-2022

Code answers related to "print digits in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language