In Rust, constants are values that are bound to a name and are not allowed to change. Constants are always immutable and are declared using the const keyword. They must be annotated with their type, and they can be set only to a constant expression.
In this challenge, you will define and use a constant in Rust. This will help you understand how to declare constants and how they can be utilized in your programs.
MAX_SIZE with a value of 100.MAX_SIZE has the type i32.MAX_SIZE from the main function.pub keyword (important for the tests to pass).const keyword to define the constant.// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { return MAX_SIZE;}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { return MAX_SIZE;}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { return MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { return MAX_SIZE;}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE :i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { return MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE : i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}pub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE : i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { return MAX_SIZE;}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.pub const MAX_SIZE:i32 = 100;// NOTE: Define the constant outside the main function// Your code herepub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE : i32 = 100;pub fn main() -> i32 { return MAX_SIZE;}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE }// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { return MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE:i32 = 100; pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.pub const MAX_SIZE: i32 = 100;// NOTE: Define the constant outside the main function// Your code herepub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// The constant must have the keyword pub to be seen by the main function outside of itpub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE: i32 = 100;pub fn main() -> i32 { MAX_SIZE}// Define a constant MAX_SIZE with a value of 100.// NOTE: Define the constant outside the main function// Your code herepub const MAX_SIZE : i32 = 100;pub fn main() -> i32 { MAX_SIZE}