Hello World Program in Rust
fn main() {
println!("Hello World!");
}
The fn
keyword is generally used to define a new function in Rust.
In this example, the fn main(){ }
declaration is used
to define the entry point to the Rust program.
println!()
is a macro that prints out the given arguments (e.g., a list of strings)
to the standard out.
If you compile and run this program, you will get the following output:
Hello World!
What's Next
If you are interested in learning Rust programming, then go ahead and set up a development environment.
- Next Step: Rust development environment setup
C C++ C# Clojure Crystal D Dart Erlang F# Go Haskell Java Javascript Julia Kotlin Lua Python Scala Swift Typescript