1. Write a perl program to compute the circumference of a circle with a given radius. To do this, you will have to create a variable to hold the radius (you can set it to a specific value for one run of the program, and then change the value in this example), and a separate variable to hold pi (lets use 3.14), as perl doesnt have a standard pi function or precomputed value. You will then need to write a statement to compute the circumference given the radius and pi. print the results.
2. Change your program above to concatenate the results of the circumference computation with the string " IS THE CIRCUMFERENCE OF THE CIRCLE\n" before printing your results.
3. Complete the test in the following perl program so that it works as advertised:
perl -le 'my $a = 10; my $b = 11; if (TEST GOES HERE) { print "$a is LESS THAN $b\n"; } else { print "$a is GREATER THAN $b\n";}'
Comments (0)
You don't have permission to comment on this page.