Rust program to perform the arithmetic operations
kw.rs
Output
kodingwindow@kw:~$ rustc kw.rs
kodingwindow@kw:~$ ./kw Addition 20 Subtraction -10 Multiplication -200 Division -10 Modulus -1 kodingwindow@kw:~$
Example 2: Rust program to perform the arithmetic operations
kw.rs
Output
kodingwindow@kw:~$ rustc kw.rs
kodingwindow@kw:~$ ./kw Addition 30 Subtraction -10 Multiplication 200 Division 2 Modulus 0 kodingwindow@kw:~$
Example 3: Rust program to perform the arithmetic operations
kw.rs
Output
kodingwindow@kw:~$ rustc kw.rs
kodingwindow@kw:~$ ./kw Addition 6.28 Subtraction 0 Multiplication 9.859601 Division 1 Modulus 0 kodingwindow@kw:~$
What Next?
Rust program to calculate the area and circumference of a circle
Rust program to accept the input from a user
Advertisement