Write a java program to input an integer and check whether it is a four digit number or not
Answers
Answered by
11
public class NumberDigits {
public static void main(String[] args) {
int count = 0, num = 3452;
while(num != 0)
{
// num = num/10
num /= 10;
++count;
}
System.out.println("Number of digits: " + count);
}
}
santoshprl1234:
Thanks nice girl
Answered by
0
Explanation:
write a program to input a number and check wherher it is a 4 digit number
Similar questions