Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 393 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 393 Bytes

Userinput:

  • main.rs

  • userinput

fn main() {
    /* line string */
    let mut line = String::new();

    /* enter your name */
    println!("Enter your name: ");

    /* store the user input under b1 and pass it to line */
    let b1 = std::io::stdin().read_line(&mut line).unwrap();
    
    /* print the user input */
    println!("Hello: {}", line);
}
$ cargo run