Tsallaka zuwa abun ciki
Justice Tech School

Rust Syntax

Every program starts at fn main. Statements end with a semicolon, blocks use curly braces and names are case sensitive. Comments use // and /* */.

Example
// a comment
fn main() {
    println!("Syntax"); /* inline */
}

Result

Syntax

Exercise

End a statement.

println!("a")

Quiz Test

Where does a Rust program start?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.