0 votes
in Rust by
How to write and run a Rust program?

1 Answer

0 votes
by

Create a file name main.rs and the below-given code in it.

fn main() {

    println!("Hello, Rust!");

}

For macOS and Linux to run open terminal, put below command

$ rustc main.rs

$ ./main

Related questions

0 votes
0 votes
asked Dec 28, 2023 in Rust by Robin
0 votes
asked Dec 28, 2023 in Rust by Robin
...