@import "std.ba"
@import "math.ba"
fun main() -> i32 {
println("Enter the radius of the circle:")
let circle_radius:
f32 = parse_float(read_line_stdin())
if circle_radius < 0 {
println("Incorrect circle radius")
} else {
let circle_area:
f32 = _MATH_PI * pow2(circle_radius)
fmt_printf("Circle area = πr² = %f\n", circle_area)
}
return 0
}
$ barn ./main.ba
$ ./b.out
Enter the radius of the circle:
20
Circle area = πr² = 1256.6