Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Unit Converter

Read a number of centimeters from the user and convert it to inches.

Use the formula: inches = centimeters / 2.54

Print the result with exactly 2 decimal places in the format: {cm} cm = {inches} inches.

Example: If the user types 10, your program should print 10 cm = 3.94 inches.

Hint: Use f64 instead of i32 for decimal numbers, and use {:.2} to format to 2 decimal places.

rust
fn main() {
}