Wednesday 27 January 2016

write a program in java to print all letters UPPERCASE to LOWERCASE without using build in function.

Code:
class Upper_Lower
{
  public static void main(String args[])
  {
    String st="COMPUTER";
    int i,c;
    for(i=0;i<st.length();i++)
    {
      c=st.charAt(i);
      if(c>=65 && c<=90)
      {
        c=c+32;
       }
      System.out.print((char)c);
    }  
  }
}

No comments:

Post a Comment