6. PL/SQL Program for Reverse of a Number | MySQL Procedure
use dbms;
drop procedure reverse;
select * from cse;
DELIMITER &&
CREATE procedure reverse()
BEGIN
declare i int;
declare rev int;
declare pow int;
set rev=0;
set pow=1;
set i=12345;
while i>0 do
set rev=(rev*10)+i%10;
set i = floor(i/10);
end while;
select rev Reversed_Number;
END &&
DELIMITER ;
CALL reverse();
0 Comments
If you have any doubts/suggestion/any query or want to improve this article, you can comment down below and let me know. Will reply to you soon.