Sunday 16 August 2015

WAP in java to check character entered is a special symbol or not.

//Check character is special symbol or not

import java.util.Scanner;

public class Spcl_Symbol {

public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter a character:");
char x=sc.next().charAt(0);

if(x>=32 && x<=47)
System.out.println("It is a Special Symbol.");
else
System.out.println("It is not a Special Symbol.");
}
}

No comments:

Post a Comment