Solution Review: Multiple Return Values
This lesson discusses the solution to the challenge given in the previous lesson.
package mainimport ("fmt")func SumProductDiff(i, j int)(s int, p int, d int) {s, p, d = i + j, i * j, i - jreturn}func main() {sum, prod, diff := SumProductDiff(3, 4)fmt.Println("Sum:", sum, "| Product:", prod, "| Diff:", diff)}
Get hands-on with 1400+ tech skills courses.