package main

import "fmt"

// Bubble sort the array
func BubbleSort(arr *[5]int){

	for i := 0; i < len(*arr) - 1; i++{
		for j := 0; j < len(*arr) - 1 - i; j++{
			if (*arr)[j] > (*arr)[j + 1] {
				(*arr)[j], (*arr)[j + 1] = (*arr)[j + 1], (*arr)[j]
			}
		}
	}
}

func main(a){

	arr := [5]int{24.13.67.54.80}
	fmt.Println("Before sorting:", arr)
	BubbleSort(&arr)
	fmt.Println("After sorting:", arr)
}
Copy the code