Computer Science, asked by santoshprl1234, 1 year ago

Write a java program to input an integer and check whether it is a four digit number or not

Answers

Answered by Anonymous
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
santoshprl1234: And my output
santoshprl1234: Faltu
Answered by kirandevidhondi
0

Explanation:

write a program to input a number and check wherher it is a 4 digit number

Similar questions