Write a Java Program to convert the given sentence from uppercase to lowercase
Answers
/* Java Program Example - Convert Lowercase Character to Uppercase */
import java.util.Scanner;
public class JavaProgram
{
public static void main(String[] input)
{
char ch;
int temp;
Scanner scan = new Scanner(System.in);
System.out.print("Enter a Character in Lowercase : ");
ch = scan.next().charAt(0);
temp = (int) ch;
temp = temp - 32;
ch = (char) temp;
System.out.print("Equivalent Character in Uppercase = " +ch);
}
}
/* Java Program Example - Convert Lowercase String to Uppercase */
import java.util.Scanner;
public class JavaProgram
{
public static void main(String[] input)
{
String strUpper, strLower;
Scanner scan = new Scanner(System.in);
System.out.print("Enter one word/name in Lowercase : ");
strUpper = scan.nextLine();
strLower = strUpper.toUpperCase();
System.out.print("Equivalent Word/Name in Uppercase : " +strLower);
}
}
Hopefully thats what your looking for let me know if its not.
:D