import java.io.*;
import java.util.*;
public class upsidedowncase
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);
String sourse,temp,c,destination;
System.out.println("Enter the String with mixed case:");
sourse=s.nextLine();
temp=sourse.toUpperCase();
for(int i=0;i<sourse.length();i++)
{
c=String.valueOf(sourse.charAt(i));
if(sourse.charAt(i)==temp.charAt(i))
{
System.out.print(c.toLowerCase());
}
else
{
System.out.print(c.toUpperCase());
}
}
}
}
OUTPUT:
post your comments here.....
import java.util.*;
public class upsidedowncase
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);
String sourse,temp,c,destination;
System.out.println("Enter the String with mixed case:");
sourse=s.nextLine();
temp=sourse.toUpperCase();
for(int i=0;i<sourse.length();i++)
{
c=String.valueOf(sourse.charAt(i));
if(sourse.charAt(i)==temp.charAt(i))
{
System.out.print(c.toLowerCase());
}
else
{
System.out.print(c.toUpperCase());
}
}
}
}
OUTPUT:
post your comments here.....
0 comments:
Post a Comment