PL/SQL Control Statement Exercises: Print 1st n numbers
PL/SQL Control Statement: Exercise-23 with Solution
Write a program in PL/SQL to print 1st n numbers.
DECLARE n number:= &first_n_number; BEGIN DBMS_OUTPUT.PUT_LINE ('The first '||n||' numbers are: '); for i in 1..n loop dbms_output.put(i||' '); END LOOP; dbms_output.new_line; END; /
Enter value for first_n_number: 10 old 2: n number:= &first_n_number; new 2: n number:= 10; The first 10 numbers are: 1 2 3 4 5 6 7 8 9 10 PL/SQL procedure successfully completed.
Improve this sample solution and post your code through Disqus
What is the difficulty level of this exercise?
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework