Hi! I'm having hard time where to put the system.out.print code in my assignment.
please check my codes, I'm still new and learning in java sorry If I have mistakes :)
here:
import java.util.Scanner;
public class SelectionSort
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Enter the size of the array: ");
int n = input.nextInt();
int[] x = new int[n];
System.out.println("Enter "+ n +" numbers: ");
for(int i=0; i<n; i++)
{
x[i] = input.nextInt();
}
for(int i=0; i<n; i++)
{
for(int j=i+1; j<n; j++)
{
if(i < j )
{
int temp = j;
j = i;
i = temp;
}
}
}
}
}