• WAP to the count the no of
digits in a no.
Answers
Answered by
0
In this example, you will learn to count the number of digits in an integer entered by the user. To understand this example, you should have the knowledge of the following C programming topics: ... This program takes an integer from the user and calculates the number of digits.
Answered by
35
Here is your answer.
class x
{
static void main(int number)
{
int c=0;
while(number! =0)
{
++c;
number/=10;
}
System.out.println("Total number of digits: "+c);
}
}
Similar questions