Getting Numbers
Part of the Fundamentals section of Coddy's Rust journey — lesson 34 of 75.
Challenge
BeginnerThe next part of our program is to get input from the program user.
After the welcome message, get two numbers (f64) from the user and store them in variables named num1 and num2.
After getting the numbers, print them to the console using println to verify the input.
Try it yourself
fn main() {
println!("Calculator App");
}All lessons in Fundamentals
4Operators Part 1
Arithmetic OperatorsModulo OperatorArithmetic ShortcutsComparison OperatorsString Comparison5Operators Part 2
Logical Operators Part 1Logical Operators Part 2Recap - Simple LogicLogical Operators Part 33Variables Part 2
Type DeclarationNaming ConventionsType InferenceRecap - Initialize VariablesType Casting9Loops
For Over SeriesWhile LoopBreakContinueNested LoopLoop LabelsInfinite LoopRecap - Dynamic Input