--------------------------
/* program to Check in put character is Lower or upper case and convert them into other */
class uporlo
{
public static void main(String a[])
{
int i;
char c;
c=a[0].charAt(0);
i=c;
if(i>=97 && i<=122)
{
System.out.println("Enterd Character is Lower Case :"+c);
i=i-32;
c=(char)i;
System.out.println(" Upper case Character is:"+c);
}
else if(i>=65 && i<=90)
{
System.out.println("Enterd Character is Upper Case :"+c);
i=i+32;
c=(char)i;
System.out.println(" Lower Case Character is:"+c);
}
else
{
System.out.println("pleas enter a correct case Character");
}
}
}
0 comments:
Post a Comment