By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,197 Members | 974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,197 IT Pros & Developers. It's quick & easy.

Help

P: n/a
Dan
Help,

I guess I need to use the round function to get my ouput like this:
For a circle with radius 3, the diameter is 18.85 and the area is
28.27.

Currently my ouput is :

For a circle with radius 3, the diameter is 18,85 and the area is
28,27.

I've been looking around and can't find a answer. Anybody's help is
grealty appericated. Thanks!
SQL> --PL/SQL Program that calculates the circumference and area of a
circle
SQL> DECLARE
2 pi CONSTANT NUMBER(9,7) := 3.1415926;
3 current_radius CONSTANT NUMBER(9) := 3;
4 diameter NUMBER (9,2);
5 area NUMBER(9,2);
6
7 BEGIN
8 diameter := 2 * pi * current_radius;
9 area := pi * current_radius ** 2;
10 DBMS_OUTPUT.PUT_LINE('For a circle with radius ' ||
current_radius ||', the diameter is '|| di
ameter ||' and the area is ' || area ||'.');
11
12
13 END;
14 /
For a circle with radius 3, the diameter is 18,85 and the area is
28,27.

PL/SQL procedure successfully completed.
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.