Menu

JAVA PROGRAM- Read a character from the User and Display whether it is a number or not

import java.util.*;
class Check_digit_m1{
public static void main(String args[]){

System.out.println("Enter a character");
Scanner sc= new Scanner(System.in);
char ch= sc.next().charAt(0);

if(ch>=48 && ch<=57)                                System.out.println("The entered  character is Digit");
else                                                 System.out.println("The entered character is not digit");


}}