Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

Output is as expected but unable to move to next lesson

package main
import "fmt"

func division(x int, y int) {
var result float64
if y!=0 {
result = float64(x/y)
fmt.Printf("The result for the division of %d by %d is %0.2f",x,y,result)
} else {
fmt.Printf("You cannot divide a number by 0")
}
}

func main() {
division(12,4)
}


output:
The result for the division of 12 by 4 is 3.00

error pop up:
Your code's output does not match the expected outcome for this exercise.
8 months ago