Answers for "go swap"

Go
1

go swap

package main

import (
	"fmt"
)

func swap(x, y string) (string, string) {
	return y, x
}

func main() {
	a, b := swap("hello", "world")
	fmt.Println(a, b)
}
Posted by: Guest on January-12-2021

Browse Popular Code Answers by Language