Create a java program that will sort the characters in ascending and descending order
Output:
import java.io.*;
import java.util.*;
public class charSorting
{
private static PrintStream pp=System.out;
public static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public static void main(String args[])throws IOException
{
char[] a=new char[5];
int x,y;
for (x=0;x
{
pp.println("You Entered a String!");
x=x-1;continue;
}
else
a[x]=b.charAt(0);
}
pp.println();
pp.print("Given Letter:");
for (y=0;y
pp.print(a[y]+" ");
}
}
0 comments:
Post a Comment