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

In level 6 lesson 8 what is the expected outcome.I am writing the correct code but it is showing not matching with expected outcome.

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)
}
by

2 Answers

schawnnah
The code you provided seems to be correctly written to calculate the area of a rectangle. When executed, it should calculate the area by multiplying the length and breadth parameters given to the "areaOfRect" function. The result is then returned and printed in the main function using fmt.Println.

If you are encountering an unexpected outcome or error message, please provide more details or the specific issue you are facing so that I can help you further.
Ayushiq5e3t
Thanks sir.Now it is not showing error and the problem is resolved

Login / Signup to Answer the Question.