Answers

2014-03-13T20:25:57+05:30
To long.. but worth :-
public class q
public static void main(String args[])throws IOException
{
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader abc=new BuffereReader(read);
int a[]=new int[10]// Any no of element you want
for(int i=0;i<a.length-1;i++)
{
for(int j=0;j<(a.length-1)-i;j++)
if(a[j]<a[j+1])//for descending order, > for ascending order
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
for(i=0;i<a.lenght-1;i++)
{
System.out.println(a[i]);
}
}
0