import java.io.*;
class constplaceCount
{
int cnt;
int numPlace(int num)
{
while (num > 0 )
{
int r = num % 10;
cnt++;
num = num / 10;
System.out.println(\"The number\"+num);
}
return cnt;
}
}
class placeCount
{
public static void main(String[] args)
{
int cnt;
constplaceCount n = new constplaceCount();
cnt = n.numPlace(50);
System.out.println(\"The count of the number places \"+cnt);
}
}
Java / PRACTICAL TUTORIAL
How to count the number of digits in any Input number other than negative numbers
Advertisement
From the community
No archived comments on this tutorial.