Monday, 30 June 2014

To write a pl/sql program for finding Multiples of 5.

Procedure:

declare
     i number(3):=5;
     n number(3):=&n;
Begin
     Dbms_output.put_line('the multiples of 5 are:');
     while i<=n
       loop
          dbms_output.put_line(i);
          i:=i+5;
     end loop;
  end;
  /

Output:

SQL> @e:\sqlpl\2.sql
Enter value for n: 20
old   3:  n number(3):=&n;
new   3:  n number(3):=20;
the multiplus of 5 are:
5
10
15                                                                                      
20

PL/SQL procedure successfully completed.

Conclusion:
        A pl/sql program is successfully executed for finding Multiples of 5.

0 comments:

Post a Comment

Copyright © ORACLE-FORU - SQL, PL/SQL and ORACLE D2K(FORMS AND REPORTS) collections | Powered by Blogger
Design by N.Design Studio | Blogger Theme by NewBloggerThemes.com