use std::f64::consts::PI; use std::io::stdin; /// Calculate the area and circumference of a circle from its radius. /// 1. Prompt for a radius input. /// 2. Parse the input into a numeric radius. /// 3. Apply the area and circumference formulas. /// 4. Print out the results. fn main() { let mut input = String::new(); println!("Enter the radius of your circle: "); stdin().read_line(&mut input).expect("No radius given."); let radius: f64 = input.trim().parse().expect("Invalid radius given."); let circumference = 2.0 * PI * radius; let area = PI * radius.powi(2); println!("The circumference is: {circumference}, and the area is: {area}."); }