Write a program in Java to enter a number and check if the number is one digit, two digit or a three digit number. Then, perform the following tasks:
• If it is a single digit number, then display its square
• It it is a double digit number, then display its square root.
• If it is a three digit number, then display its cube root.
Otherwise, display the message “The number entered is more than three digits”
Answers
Answered by
1
Answer:
Input : 1234 Output : 1 Explanation : The sum of 1+2+3+4 = 10, ... C++ program to find sum of ... Loop to do sum while ... Driver program to test the above function ... If a number n is divisible by 9, then the sum of its digit until ...
Answered by
0
Explanation:
import java util scanner;
class name
{
public static void main( string arg[ ])
{
int a;
system.out.println( "the no."=+a);
a=in.nextInt();
{
if (it is a single digit no a×a) )
}
{
if (it is a double digit no. (a 1/3))
}
{
if (it is a three digit no (a)
}
}
}
Similar questions