You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::io;fnmain(){println!("Please enter the first number: ");letmut first = String::new();
io::stdin().read_line(&mut first).unwrap();letmut a:u32 = 0;match first.trim().parse(){Ok(value) => a = value,Err(_error)=> eprintln!("This is unfortunately not a number")};println!("Please enter the second number: ");letmut second = String::new();
io::stdin().read_line(&mut second).unwrap();letmut b:u32 = 0;match second.trim().parse(){Ok(value) => b = value,Err(_error)=> eprintln!("This is unfortunately not a number")};let result = sum(a, b);println!("Result: {}", result);}fnsum(a:u32,b:u32) -> u32{
a + b
}
https://github.com/prophen/intro-to-rust/blob/nikema's-notes/exercises/07.md
The text was updated successfully, but these errors were encountered: