+ 1

please help me for solve this problem write code in java {3,5,6,8{3,5,1,2}5,6,7,9,10} this is array of integer how can remove the braces and sort the element of array.

28th Dec 2016, 9:18 AM
Madhuri Choudhari
Madhuri Choudhari - avatar
2 Respostas
+ 1
u can sort this by: import java.util.*; public class Program { public static void main(String args[]) { Scanner in=new Scanner(System.in); int i,j,t,min; int m[]=new int[10]; for(i=0;i<10;i++) { System.out.print("ENTER THE NO. IN THE CELL"); m[i]=in.nextInt(); } for(i=0;i<9;i++) { min=i; for(j=i+1;j<10;j++) { if(m[j]<m[min]) min=j; } t=m[i]; m[i]=m[min]; m[min]=t; } System.out.println("The ARRANGED IN ASCENDING ORDER ARE"); for(i=0;i<10;i++) System.out.println(m[i]); } }
28th Dec 2016, 12:35 PM
RUTIKA SANSARIA
RUTIKA SANSARIA - avatar
+ 1
but sorry I don't know of removing braces
28th Dec 2016, 12:36 PM
RUTIKA SANSARIA
RUTIKA SANSARIA - avatar