import java.util.*;
public class Convert
{
public static void main(String args[])
{
System.out.println("Enter the String");
String s1,s2="";
char ch;
Scanner in=new Scanner(System.in);
s1=in.nextLine();
int len=s1.length();
for(int i=0;i<len;i++)
{
ch=s1.charAt(i);
if(ch>=97 && ch <=122)
{
ch-=32;
}
s2=s2+ch;
}
System.out.println("Converted string is:"+s2);
}
}
public class Convert
{
public static void main(String args[])
{
System.out.println("Enter the String");
String s1,s2="";
char ch;
Scanner in=new Scanner(System.in);
s1=in.nextLine();
int len=s1.length();
for(int i=0;i<len;i++)
{
ch=s1.charAt(i);
if(ch>=97 && ch <=122)
{
ch-=32;
}
s2=s2+ch;
}
System.out.println("Converted string is:"+s2);
}
}
No comments:
Post a Comment