wap in java to input a number from the user and arrrange the digits of number in ascending order
Answers
Answered by
4
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public calss Ascending{
public static void main(String...args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str=br.readLine();
char[] store=str.toCharArray();
Arrays.sort(store);
for(char x:store){
System.out.print(x);
}
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public calss Ascending{
public static void main(String...args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str=br.readLine();
char[] store=str.toCharArray();
Arrays.sort(store);
for(char x:store){
System.out.print(x);
}
}
}
lily978:
Do u know how to make it from string ?
Similar questions