Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 6 Lesson 8 Go Course

package main
import "fmt"

func areaOfRect(length float64, breadth float64) float64 {
return (length*breadth)

}

func main() {
area := areaOfRect(7,9)
fmt.Println("Area of Rectangle is: ", area)
}

Error:
Have you added the return statement in the function areaOfRect?
by

2 Answers

sam5epi0l
Please try to use proper formatting

package main
import "fmt"
func areaOfRect(length float64, breadth float64) float64 {
// write code here
return length*breadth
}
func main() {
area := areaOfRect(7,9)
fmt.Println("Area of Rectangle is:", area)
}
iamabhishek
Please try now, it should work.

Login / Signup to Answer the Question.