Search⌘ K

Exercise: Deduce the Outputs

Explore how to deduce outputs from given Golang code exercises. This lesson helps reinforce your understanding of functions and control structures by analyzing behavior and expected results.

We'll cover the following...

Choose one correct answer.

1.

What will the following function return for x=2 and y=5?

func isGreater(x, y int) bool {
  if x > y {
  	return true
  }
  	return false
}
A.

True

B.

False

C.

None of the above


1 / 15

We hope that you ...