About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Tuesday, July 26, 2011

***sorting the Array***


//sorting the Array


import java.io.*;
import java.util.*;
class SortingArray
{
public static void main(String aa[])throws IOException
{
int arr[]=new int[10];
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter 10 elements in Array...");
for(int i=0;i<10;i++)
{
arr[i]=Integer.parseInt(br.readLine());


}


Arrays.sort(arr);


System.out.println("Sorted elements in Array...");
for(int i=0;i<10;i++)
{
System.out.println(" "+arr[i]);


}



}
}


Output


No comments: