create a program to find out if the number entered by the user is a two,three, or four digits number. Sample input:1023 sample output:1023 is a four digit number
Answers
Answered by
5
Okay ,in JAVA :
import java.util.*;
class Prog
{
public void program()
{
Scanner ob=new Scanner(System.in);
int n=ob.nextInt();
int c=0;
int cpy=n;
while(n>0)
{
c++;
n=n/10
}
System.out.println(cpy+" is a "+c+" digit number");
}
}
Answered by
1
Answer:
here is your soln in the attachment above
Attachments:
Similar questions