employer cover photo
employer logo
employer logo

Hiteshi Technologies

Is this your company?

Hiteshi Technologies Interview Question

Convert string from upper case to lower case?

Interview Answer

Anonymous

Apr 20, 2020

import java.util.Scanner; public class UpperToLower{ public static void main(String args[]){ String upperStr; int i; Scanner sc = new Scanner(System.in); System.out.println("Enter any name to convert in lowercase"); upperStr = sc.nextLine(); char str[]=upperStr.toCharArray(); for(i=0;i='A' && str[i]<='Z') { str[i]=(char)((int)str[i]+32); } } System.out.println("The name in LowerCase is"); for(i=0;i