Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class MyClass {
- public static void main(String args[]) {
- Scanner myObj = new Scanner(System.in);
- System.out.println("input a number: ");
- double num = myObj.nextDouble();
- if (num % 1 == 0){
- System.out.println("This number is integer");
- }
- else{
- System.out.println("this number is decimal");
- }
- }
- }
Add Comment
Please, Sign In to add comment