Write a JAVA program to accept a character and check whether it is a letter, digit or a special character.
All the best !
Answers
Answered by
8
Program : {JAVA}
public class Prog1
{
void get(char ch)
{
if(Character.isLetter(ch))
System.out.println("Entered character is a Letter: "+ch);
else if(Character.isDigit(ch))
System.out.println("Entered character is a Digit: "+ch);
else
System.out.println("Entered character is a Special character: "+ch);
}
}
Similar questions
Hindi,
14 days ago
Math,
14 days ago
Hindi,
14 days ago
Computer Science,
29 days ago
Computer Science,
29 days ago