I'm not sure how you'd do this in C++, but I could have a go at it in php since that's what I know.
You know that Pi is approximately 22/7, in php you can use the pi function.
You'd need your input(radius) to come from a form if it was web-based, which is simple enough.
perimeter = 2nr = 2 x (22/7) x r
function getPerimeter ($input) {
$input = $_GET['formInput'];
$pi=pi();
$perimeter = (2*$pi)*$input;
return $perimeter;
}
HTH
Copyright © 2026 eLLeNow.com All Rights Reserved.