Back to: Java Program’s
0
public class Q7_2008
{
static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter something :");
String s=sc.next();
String r="";
for(int i=0;i<s.length();i++)
{
char ch=s.charAt(i);
if(Character.isUpperCase(ch))
{
r=r+Character.toLowerCase(ch);
}
else if(Character.isLowerCase(ch))
{
r=r+Character.toUpperCase(ch);
}
else
r+=ch;
}
System.out.println("Output:"+r);
}
}
Submitted By: Ms. Suchetana Mukherjee
If this program was helpful to you, do leave a comment.
All Creadit goes to Ms. Suchetana Mukherjee
P.N. : All the post on this website are for demonstration and education purpose only.
Student should perform all the practicals for there personal copies.