-
Book Overview & Buying
-
Table Of Contents
The Rust Programming Handbook
By :
Write a Rust program that declares an immutable variable and then shadows it with a new value. Also, declare a mutable variable and change its value.
Create a struct to represent a rectangle with width and height. Implement a method to calculate the area of the rectangle.
Write a Rust program that uses an if statement to check if a number is positive, negative, or zero. Also, create a loop that prints numbers from 1 to 10.
Implement a function that takes two integers and returns their sum. Also, create a closure that multiplies two numbers and use it in a higher-order function.
Create a module named math with a function to calculate the square of a number. Use this function in the main program.