You may try sorting the array with: Arrays.sort(abc);
And then can have a simple reverse for loop to display last 5 numbers. Hope this could help you. Thanks! Alpesh Khunt On Sun, Jul 26, 2009 at 2:07 PM, nguyen thanh lam <[email protected]>wrote: > > int abc[]={1,2,7,95,43,21,22,12,11}; > > how to output top 5 number which are greater than others? > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
