// count number of given digits
class NumberOfDigits
{
public static void main( String args[ ] )
{
int n, c;
n = 1234;c = 0;
while( n != 0 )
{
n = n / 10;
c++;
}
System.out.println( " Number of Digits : " + c );
}
}
Output:Number of Digits : 4
// count number of given digits
class NumberOfDigits
{
public static void main( String args[ ] )
{
int n, c;
n = 1234;c = 0;
while( n != 0 )
{
n = n / 10;
c++;
}
System.out.println( " Number of Digits : " + c );
}
}
Output:Number of Digits : 4
Program 2 to create Applet with param tag in Java
Program to explain Simple Generic class in Java
How to Add Jar Files in Library of project in IntelliJ Idea
AWT frame class example in Java
Jav Program to find sum of two matrices
Polymorphism with interface example in Java
Program to explain Calling super class constructor using super in Java
Program to use Java Enum as a Class type in Java
Program to find Strong number in Java
Program to use GridBagLayout in Java
Java Program for Converting Rupees into Paisa
Using class with import example in Java