by @saigowthamr

How to write a hello world in Rust

Home » rust » How to write a hello world in Rust

This example will show you how to write a hello world program in Rust

fn main() {
    //it Prints hello world
    println!("Hello World!");
}

Compiling code

To compile and run the above code use the following command.

rustc hello.rs

It will print the Hello World! to the console.