###### tags: `Note` # Hello, World! ## Using `rustc` Creating new file named `main.rs` and writing the code to `main.rs`. ```rust fn main() { println!("Hello, world!"); } ``` Then, running following commands to **compile** the file and run it. ```bash $ rustc main.rs $ ./main Hello, world! ``` :::info The function `main` is entrypoint of rust programe. ::: ## Using Cargo ```bash $ cargo new hello_cargo $ cd hello_cargo ```