S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What is the output of the expression 5 / 2 in Rust?

  • (A) 2.5
  • (B) 2
  • (C) 3
  • (D) Compilation error
  • Correct Answer - Option(B)
  • Views: 33
  • Filed under category Rust
  • Hashtags:

Explanation by: Shyam Dubey

Integer division truncates the decimal part, so 5 / 2 equals 2.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.