+ 4
Error in SelectionSort_JAVA !!!
what's the problem? help me to solve it thank you^
6 ответов
+ 17
where is the code ?
//without any code we can't figure out where is the error
edit :::
public class Program
{
public static void main(String[] args) {
int[] arr = new int[]{3,8,2,5,9,10,1,4,7,6};
int min;
int temp = 0;
for(int i = 0;i<=arr.length-2;i++)
for(int j=i+1;j<=arr.length-1;j++)
if(arr[j] > arr[i])
{
min = j;
temp = arr[i];
arr[i] = arr[min];
arr[j] = temp;
}
for(int i=0;i<arr.length;i++)
{
System.out.println(arr[i]);
}
}
}
+ 7
Insert a code to your post please
+ 2
Could you please post your code, then we can help you.
+ 2
excuse me i have been joined to solo recently i am amature
+ 2
Yeah! it worked .... thanks guys ;D