Cube and Cuberoot of a Number

00:44 1 Comments A+ a-

Write a PLSQL block to calculate Cube and Cuberoot of a number.



Program:



declare
a int:=8;
cube int;
root int;
begin
cube:= a*a*a;
select power(8,1/3) into a from dual;dbms_output.put_line('The Cube of the number is'||cube);
dbms_output.put_line('The cuberoot of number is' || a);
end;
/


Output:
The Cube of the number is 512

The cuberoot of number is 2

1 comments:

Write comments
Unknown
AUTHOR
17 August 2021 at 21:35 delete

declare
a int:=8;
cube int;
root int;
begin
cube:= a*a*a;
select power(8,1/3) into a from dual;dbms_output.put_line('The Cube of the number is'||cube);
dbms_output.put_line('The cuberoot of number is' || a);
end;
/

Reply
avatar