Calculate Area and Circumference of Circle in Perl

Perl Program to find the Area and Circumference of the Circle from the given radius.

Source code :


$PI = 3.14159265358979323846;

$radius = 10; # Change the radius here


$area = $PI * $radius * $radius;
$circumference = 2 * $PI * $radius;

print "Given Radius : $radius \nArea : $area\nCircumference : $circumference";

Output :

Given Radius : 10
Area : 314.159265358979
Circumference : 62.8318530717959

Output :


                

Comments :