PRINT : alphabets , digits , special symbols
Define a class to declare a character array of size ten , accept the character into the array and
PERFORM THE FOLLOWING :
[i]Print all the alphabets in it.
[ii]Print all the digits int it.
[iii]Print all the special symbols in it.
import java.util.*;
public class pRint {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
char c[] = new char[10];
System.out.println("ENTER TEN CHARACTERS : ");
for(int i =0 ; i<10; i++)
c[i] = sc.next().charAt(0);
System.out.println("ALPHABETS" + " \t" + "DIGITS" + "\t" + "SPECIAL SYMBOLS");
for (int i = 0; i<10 ; i++)
{
if(Character.isLetter(c[i]))
System.out.println("ALPHABETS : " + c[i]+"\t");
else
if(Character.isDigit(c[i]))
System.out.println("DIGITS : " + c[i]+"\t");
else
System.out.println("SPECIAL SYMBOLS : " + c[i]+ "\t");
}
}
}
FOR CODE ,
CLICK : https://onecompiler.com/java/3xyws5urn(TO FIND OUTPUT)