class Bubbesort
{
public static void main(String args[])
{
int sum, i,j,temp = 0;
int []a = new int[5];
for(i=0;i< 5;i++)
a[i] = Integer.parseInt(args[i]);
for(i=0;i< 5;i++)
{
for(j=i+1;j< 5;j++)
{
if (a[i] < a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
for(i=0;i< 5;i++)
System.out.println(a[i]);
}
}
Labels: Core Java
Subscribe to:
Post Comments (Atom)
thank u so much.......
this is really very useful for us!!1