mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-09 12:11:28 +08:00
Use public class
This commit is contained in:
@ -1,14 +1,15 @@
|
|||||||
import java.util.*;
|
|
||||||
package Maths;
|
package Maths;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
// count the number of digits in a number
|
// count the number of digits in a number
|
||||||
class CountDigit {
|
public class CountDigit {
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
Scanner sc = new Scanner(System.in);
|
Scanner sc = new Scanner(System.in);
|
||||||
System.out.print("Enter the number: ");
|
System.out.print("Enter the number: ");
|
||||||
int number = sc.nextInt();
|
int number = sc.nextInt();
|
||||||
int digits = 0;
|
int digits = 0;
|
||||||
if(number == 0)
|
if(number == 0){
|
||||||
{
|
|
||||||
System.out.println("The number of digits present in the number: 1");
|
System.out.println("The number of digits present in the number: 1");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user