SQL> declare
2 a number;
3 b number;
4 c number;
5 d number;
6 begin
7 a:=&a;
8 b:=&b;
9 c:=&b;
10 if(a>b)and(a>c) then
11 dbms_output.put_line('A is maximum');
12 elsif(b>a)and(b>c)then
13 dbms_output.put_line('B is maximum');
14 else
15 dbms_output.put_line('c is maximum');
16 end if;
17 end;
18 /
Enter value for a: 21
old 7: a:=&a;
new 7: a:=21;
Enter value for b: 12
old 8: b:=&b;
new 8: b:=12;
Enter value for b: 45
old 9: c:=&b;
new 9: c:=45;
c is maximum
PL/SQL procedure successfully completed.
SQL> declare
2 n number;
3 sum1 number default 0;
4 endvalue number;
5 begin
6 endvalue:=&endvalue;
7 n:=1;
8 for n in 1..endvalue
9 loop
10 if mod(n,2)=1
11 then
12 sum1:=sum1+n;
13 end if;
14 end loop;
15 dbms_output.put_line('sum='||sum1);
16 end;
17 /
Enter value for endvalue: 4
old 6: endvalue:=&endvalue;
new 6: endvalue:=4;
sum=4
PL/SQL procedure successfully completed.

More Related Content

TXT
New text document
DOCX
Program for pyramid
PDF
C mcq practice test 2
PDF
PDF
Python OpenCV Real Time projects
PDF
C mcq practice test 1
DOCX
C++ program: Numbers .cpp
New text document
Program for pyramid
C mcq practice test 2
Python OpenCV Real Time projects
C mcq practice test 1
C++ program: Numbers .cpp

What's hot (19)

DOCX
Tugas2
DOCX
Lab loop
DOCX
Write a program to perform translation
DOCX
Assignement of programming & problem solving
PDF
201801 CSE240 Lecture 11
DOCX
Bti1022 lab sheet 9 10
DOCX
Basic Programs of C++
PDF
Do while loop
 
PPTX
Activities on Operands
DOC
PDF
1 borland c++ 5.02 by aramse
DOCX
Dam31303 dti2143 lab sheet 7
PPTX
Function basics
DOCX
คำสั่ง Do while
PDF
Prime number program in c
PDF
Bcsl 033 data and file structures lab s5-2
PDF
c++ program using All data type and operators
PPTX
C- Programs - Harsh
DOCX
C++ file
Tugas2
Lab loop
Write a program to perform translation
Assignement of programming & problem solving
201801 CSE240 Lecture 11
Bti1022 lab sheet 9 10
Basic Programs of C++
Do while loop
 
Activities on Operands
1 borland c++ 5.02 by aramse
Dam31303 dti2143 lab sheet 7
Function basics
คำสั่ง Do while
Prime number program in c
Bcsl 033 data and file structures lab s5-2
c++ program using All data type and operators
C- Programs - Harsh
C++ file
Ad

Viewers also liked (19)

PDF
Dsp 2marks
PDF
Manit bhopal group_1_latex_assignment_part_2-1
DOC
Unit1 and 2 sample solutions
PDF
teknik tenaga listrik
PDF
Java basics notes
PDF
petunjuk praktis penelitian ilmiah
DOCX
CV_ SHAMBHAVI.doc_ahmdbd
DOC
Questions unit2 ch3
DOC
Questions unit3
PDF
Power system and communication network co simulation for smart grid applications
DOC
Conventional sources of energy (power generation) 01
PDF
Engineering physics 2(Electron Theory of metals)
DOC
Unit 2 rangkaian dc
PDF
EE2356 Microprocessor and Microcontroller Lab Manuel
DOC
Unit 1 prinsip dasar listrik
PDF
Teknologi sistem pengendalian tenaga listrik berbasis scada
DOCX
Instruction set of 8086 Microprocessor
DOC
Questions unit4
DOC
Unit1questions
Dsp 2marks
Manit bhopal group_1_latex_assignment_part_2-1
Unit1 and 2 sample solutions
teknik tenaga listrik
Java basics notes
petunjuk praktis penelitian ilmiah
CV_ SHAMBHAVI.doc_ahmdbd
Questions unit2 ch3
Questions unit3
Power system and communication network co simulation for smart grid applications
Conventional sources of energy (power generation) 01
Engineering physics 2(Electron Theory of metals)
Unit 2 rangkaian dc
EE2356 Microprocessor and Microcontroller Lab Manuel
Unit 1 prinsip dasar listrik
Teknologi sistem pengendalian tenaga listrik berbasis scada
Instruction set of 8086 Microprocessor
Questions unit4
Unit1questions
Ad

Similar to 5 a4.output (20)

PPTX
PL-SQL DIFFERENT PROGRAMS
PDF
DOCX
PLSQL.docx
PPTX
PDF
PL /SQL program UNIT 5 DMS 22319
PPTX
Plsql coding conventions
PDF
Plsql programs(encrypted)
PDF
BScPLSQL.pdf
DOC
Mc amca04919 plsql programs
DOC
Plsql task answers
PPT
PL/SQL Introduction and Concepts
PDF
OOW19 - Ten Amazing SQL features
PPTX
Pl-sql blocks and block types and variablesdeclaring.pptx
PPTX
SQL and PLSQL features for APEX Developers
PPT
SQL- Introduction to PL/SQL
PPT
PPTX
Ch as pbdasdadssadsadsadasdasdasdas fdt .pptx
PPTX
PLSQLmy Updated (1).pptx
PPTX
PL_SQL, Trigger, Cursor, Stored procedure ,function
PDF
Programming in Oracle with PL/SQL
PL-SQL DIFFERENT PROGRAMS
PLSQL.docx
PL /SQL program UNIT 5 DMS 22319
Plsql coding conventions
Plsql programs(encrypted)
BScPLSQL.pdf
Mc amca04919 plsql programs
Plsql task answers
PL/SQL Introduction and Concepts
OOW19 - Ten Amazing SQL features
Pl-sql blocks and block types and variablesdeclaring.pptx
SQL and PLSQL features for APEX Developers
SQL- Introduction to PL/SQL
Ch as pbdasdadssadsadsadasdasdasdas fdt .pptx
PLSQLmy Updated (1).pptx
PL_SQL, Trigger, Cursor, Stored procedure ,function
Programming in Oracle with PL/SQL

5 a4.output

  • 1. SQL> declare 2 a number; 3 b number; 4 c number; 5 d number; 6 begin 7 a:=&a; 8 b:=&b; 9 c:=&b; 10 if(a>b)and(a>c) then 11 dbms_output.put_line('A is maximum'); 12 elsif(b>a)and(b>c)then 13 dbms_output.put_line('B is maximum'); 14 else 15 dbms_output.put_line('c is maximum'); 16 end if; 17 end; 18 / Enter value for a: 21 old 7: a:=&a; new 7: a:=21; Enter value for b: 12 old 8: b:=&b; new 8: b:=12; Enter value for b: 45 old 9: c:=&b; new 9: c:=45; c is maximum PL/SQL procedure successfully completed. SQL> declare 2 n number; 3 sum1 number default 0; 4 endvalue number; 5 begin 6 endvalue:=&endvalue; 7 n:=1; 8 for n in 1..endvalue 9 loop 10 if mod(n,2)=1 11 then 12 sum1:=sum1+n; 13 end if; 14 end loop; 15 dbms_output.put_line('sum='||sum1); 16 end; 17 / Enter value for endvalue: 4 old 6: endvalue:=&endvalue; new 6: endvalue:=4; sum=4 PL/SQL procedure successfully completed.