write a program in Java to show whether the given number is Dec number or not
Answers
Answered by
1
Answer:
import java.util.*;
public class Decimal
{
public static void main(String args[ ])
{
Scanner in=new Scanner(System.in);
double a;
System.out.println("Enter the number");
a=in.nextDouble();
if(a==(double)a)
System.out.println(a + " is a decimal number");
else
System.out.println(a + " is not a decimal number");
}
}
Similar questions