Write a PL/SQL program to print reverse of a number. For example: 1234 print as 4321.
Write a PL/SQL program to print reverse of a number. For example: 1234 print as 4321.
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
DECLARE n1 NUMBER; rev NUMBER; BEGIN n1:=1234; rev:=0; WHILE n1>0 LOOP rev:=(rev*10) + mod(n1,10); n1:=floor(n1/10); END LOOP; DBMS_OUTPUT.PUT_LINE('Reverse of the number is: ' || rev); END;