Sunday, 4 January 2015

PL/SQL program to display the numbers in recursive order

Program:

      Declare 
          a number(4);
          rev number(4);
          d number(4);
      begin 
          a:=&a;
          rev:=a;
      while a>0
      Loop
          d:=mod(a,10);
          rev=(rev*10)+d;
          a:=trunc(a/10);
     end loop;
     dbms. output. put_line('rev ='¦¦rev) ;
     end;
     /

No comments:

Post a Comment