NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

/*
name:bigyan pathak
id:18413698
--@D:bigyanterm2loop_prac.txt
*/

SET SERVEROUTPUT ON

DECLARE
vn_length NUMBER(25):=0;
vn_counter NUMBER(25):=1;
vc_firstname VARCHAR2(25):='BIGYAN';
vc_surname VARCHAR2 (25):='PATHAK';


BEGIN
vn_length := LENGTH(vc_firstname);

LOOP

DBMS_OUTPUT.PUT_LINE(SUBSTR(vc_firstname,vn_counte
r,1));
EXIT WHEN vn_counter>vn_length;
vn_counter:= vn_counter+1;

END LOOP;
END;
/




--while loop_prac

DECLARE
vn_length NUMBER(25):=0;
vn_counter NUMBER(25):=1;
vc_firstname VARCHAR2(25):='BIGYAN';
vc_surname VARCHAR2 (25):='PATHAK';


BEGIN
vn_length := LENGTH(vc_firstname);

WHILE vn_counter<=vn_length LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(vc_firstname,vn_counte
r,1));
vn_counter:= vn_counter+1;

END LOOP;
END;
/

--for loop_prac

DECLARE
vn_length NUMBER(25):=0;
vn_counter NUMBER(25):=1;
vc_firstname VARCHAR2(25):='BIGYAN';
vc_surname VARCHAR2 (25):='PATHAK';


BEGIN
vn_length := LENGTH(vc_firstname);

FOR vn_counter IN 1..vn_length LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(vc_firstname,vn_counte
r,1));
END LOOP;
END;
/



--BONUS ACTIVITY ONE

DECLARE
vn_length NUMBER(25);
vn_counter NUMBER(25):=1;
vc_firstname VARCHAR2(25):='BIGYAN';
vc_middlename VARCHAR2 (25) := 'RAJ';
vc_surname VARCHAR2 (25):='PATHAK';


BEGIN
vn_length := LENGTH(vc_surname);
DBMS_OUTPUT.PUT_LINE(' ----firstname name---
');
LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(vc_firstname,vn_counte
r,1));
EXIT WHEN vn_counter>vn_length;
vn_counter:= vn_counter+1;
END LOOP;

--using while loop
vn_counter:=1;--set the value of vn_counter 0...
DBMS_OUTPUT.PUT_LINE(' ----middlename--- ');
WHILE vn_counter<=vn_length LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(vc_middlename,vn_count
er,1));
vn_counter:= vn_counter+1;

END LOOP;
--using for loop
DBMS_OUTPUT.PUT_LINE(' ----surname--- ');
FOR vn_counter IN 1..vn_length LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(vc_surname,vn_counter,
1));
END LOOP;
END;

/



--BONUS ACTIVITY TWO

-- BONUS ACTIVITY TWO
DECLARE
vc_letters VARCHAR2(30) := 'ABCDE';
vn_numbers NUMBER(4) := 1234;
BEGIN
FOR vn_count_letter IN 1 .. LENGTH(vc_letters) LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(vc_letters,vn_count_le
tter,1));
FOR vn_count_num IN 1 .. LENGTH(vn_numbers) LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(vn_numbers,vn_count_nu
m,1));
END LOOP;
END LOOP;
END;
/

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.