A

Admin • 802.91K Points
Coach

Q. Which of the following is a valid way to define a function in Rust?

  • (A) function my_func() {}
  • (B) def my_func() {}
  • (C) fn my_func() {}
  • (D) func my_func() {}
  • Correct Answer - Option(C)
  • Views: 2
  • Filed under category Rust
  • Hashtags:

Explanation by: Admin
Rust uses the 'fn' keyword to define functions.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.