fn main() {
    println!("What's your name?");

    // create an empty growable String object
    let mut name = String::new();

    // read user input
    std::io::stdin()
        .read_line(&mut name)
        .expect("Read line error");  
    
    println!("Hello, {}!", name);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: