This lesson gets you acquainted with the Hello World program in Rust.
Rust code is always put in a file with .rs
extension.
Hello World Program
Below is the source code for a traditional Hello World program. For a better understanding, you can take the AI mentor’s help.
Rust 1.40.0
fn main() {println!("Hello World!");}
Anatomy of a Hello World Program #
Let’s look at the anatomy of a Hello World program. We’ll start from the very first line and go step by step.
Line 1: The main function is the beginning of every Rust ...