Arrange array in ascending order

Hi,
How do i arrange an array of number for e.g.
int [] array = {3,2,7,4,9,1};
into ascending order without using the sort() function?

Thanks

Did your professor recommend any sorting algorithms?

Not really.
I was trying to do this using for loops. Can’t seem to get the conditions right.

Might try with Bubble sort …