Created
March 5, 2022 15:54
-
-
Save xvbnm48/f3f5fcf5156b73964e5cc23f078477eb to your computer and use it in GitHub Desktop.
function return vbalue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main(){ | |
JumlahLuas, jumlahKeliling := hitungReturnValue(30, 20) | |
fmt.Println("luas", JumlahLuas, "keliling", jumlahKeliling) | |
} | |
func hitungReturnValue(panjang, lebar int) (luas int, keliling int) { | |
luas = panjang * lebar | |
keliling = 2 * (panjang + lebar) | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment