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

Issue with Go Lang Level6>Lesson 8

Unable to move forward.Not sure what issue was there in below code
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)
}
by

1 Answer

iamabhishek
There is some issue with blanks, if you revisit the app, it should be fixed now.

This is the correct code:

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

Login / Signup to Answer the Question.