Challenge 2: Make a Calculator
Explore how to create a calculator in Rust by handling multiple operators with match statements. Learn to perform arithmetic operations and manage invalid inputs or errors like division by zero, building your skills in Rust control flow.
We'll cover the following...
We'll cover the following...
Problem Statement
Write a code which will take:
-
Two variables named
aandb -
a character type variable called
operatorwhich will take operators (+,-,/,*,%) will be passed as input to ourmatchstatement -
Use
match...