Write a java program to enter a value and check and print whether it is a digit, an alphabet or a special charecter
Answers
Answered by
1
Answer:
import java.util.*
class test {
public static void main(String [ ] args)
{
char c= '*';
if ((c>='a' && c<='z') || (c>='A' && c<= 'Z'))
System.out.println(c + " is an alphabet .");
else
System.out.println(c + " is not an alphabet. ");
int a;
if( a>=48 && a<=57)
System.out.println( "it is a digit);
else if(a>=9 && a<=47)
System.out.println ("it is a special character");
}
}
Similar questions