Rust Programming Basics

Check your grasp of Rust syntax,ownership,and borrowing concepts.

1. What keyword is used to declare a mutable variable in Rust?
2. Which of the following is NOT a basic numeric type in Rust?
3. What is the result of the expression `5 + 3 * 2` in Rust?
4. Which of the following allows a function to return a value without using the `return` keyword?
5. What does the `Option<T>` enum represent?
6. Which of the following is the correct way to create a string literal in Rust?
7. What is the default visibility of items in a Rust module?
8. Which trait allows a type to be printed with `println!("{}", x)`?
9. Which of the following are valid ownership rules in Rust?
10. Which of these are primitive types in Rust?
11. Which statements about Rust's error handling are true?
12. Which of the following are valid loop constructs in Rust?
13. What are valid ways to handle a `Result<T, E>` in Rust?
14. Rust is a garbage-collected language.
15. The `&mut T` type represents a mutable reference.
16. In Rust, variables are mutable by default.
17. The `enum` keyword is used to define enumeration types in Rust.
18. What keyword is used to import items from another module? (lowercase)
19. What is the name of Rust's package manager and build tool? (lowercase)
20. What keyword is used to declare a function in Rust? (lowercase)
Answered 0 of 0 — 0 correct