Gistlib Logo

gistlib

print hello world in rust

To print "Hello, world!" in Rust, you can use the println! macro:

main.rs
fn main() {
    println!("Hello, world!");
}
45 chars
4 lines

This will print Hello, world! to the console when you run the program.

similar rust code snippets

insert an element into an array at a specific index in rust
remove an element from an array at a specific index in rust
remove an element from the middle of an array in rust
find the index of an element in an array in rust
sort an array in rust
remove an element from the beginning of an array in rust
add an element to the beginning of an array in rust
add an element to the end of an array in rust
remove an element from the end of an array in rust
reverse an array in rust

related categories

rust
printing
hello world

gistlibby LogSnag