Math, asked by Anonymous, 9 months ago

(java program) How do you input a number and check if it is a positive 5-digit number or not​

Answers

Answered by Anonymous
4

Step-by-step explanation:

import java.util.*;

class FiveDigNum

{

public static void main(String args[])

{

Scanner sc=new Scanner (System.in);

int n;

System.out.println("enter a number");

n=sc.nextInt();

if(n/10000>0)

System.out.println("a 5digitpositivenumber");

else

System.out.println("not a5digitnumber");

}

}

Attachments:

Anonymous: Awesome
Similar questions