Cube and Cuberoot of a Number
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 commentsdeclare
Replya 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;
/