SlideShare a Scribd company logo
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

What's hot

Tugas2
Tugas2Tugas2
Tugas2
Av Ri
 
Lab loop
Lab loopLab loop
Lab loop
Manode Boonpeng
 
Write a program to perform translation
Write a program to perform translationWrite a program to perform translation
Write a program to perform translation
Shobhit Saxena
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
Syed Umair
 
201801 CSE240 Lecture 11
201801 CSE240 Lecture 11201801 CSE240 Lecture 11
201801 CSE240 Lecture 11
Javier Gonzalez-Sanchez
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
alish sha
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
Bharat Kalia
 
Do while loop
Do while loopDo while loop
Do while loop
BU
 
Activities on Operands
Activities on OperandsActivities on Operands
Activities on Operands
Nicole Ynne Estabillo
 
C test
C testC test
1 borland c++ 5.02 by aramse
1   borland c++ 5.02 by aramse1   borland c++ 5.02 by aramse
1 borland c++ 5.02 by aramse
Aram SE
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
alish sha
 
Function basics
Function basicsFunction basics
Function basics
mohamed sikander
 
คำสั่ง Do while
คำสั่ง Do whileคำสั่ง Do while
คำสั่ง Do while
kramsri
 
Prime number program in c
Prime number program in cPrime number program in c
Prime number program in c
Hitesh Kumar
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
Dr. Loganathan R
 
c++ program using All data type and operators
c++ program using All data type and operators c++ program using All data type and operators
c++ program using All data type and operators
AMUDHAJAY
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - Harsh
Harsh Sharma
 
C++ file
C++ fileC++ file
C++ file
Mukund Trivedi
 

What's hot (19)

Tugas2
Tugas2Tugas2
Tugas2
 
Lab loop
Lab loopLab loop
Lab loop
 
Write a program to perform translation
Write a program to perform translationWrite a program to perform translation
Write a program to perform translation
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
201801 CSE240 Lecture 11
201801 CSE240 Lecture 11201801 CSE240 Lecture 11
201801 CSE240 Lecture 11
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
Do while loop
Do while loopDo while loop
Do while loop
 
Activities on Operands
Activities on OperandsActivities on Operands
Activities on Operands
 
C test
C testC test
C test
 
1 borland c++ 5.02 by aramse
1   borland c++ 5.02 by aramse1   borland c++ 5.02 by aramse
1 borland c++ 5.02 by aramse
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
Function basics
Function basicsFunction basics
Function basics
 
คำสั่ง Do while
คำสั่ง Do whileคำสั่ง Do while
คำสั่ง Do while
 
Prime number program in c
Prime number program in cPrime number program in c
Prime number program in c
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
 
c++ program using All data type and operators
c++ program using All data type and operators c++ program using All data type and operators
c++ program using All data type and operators
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - Harsh
 
C++ file
C++ fileC++ file
C++ file
 

Viewers also liked

Dsp 2marks
Dsp 2marksDsp 2marks
Dsp 2marks
Hari Kumar
 
Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1
Dr. Krishna Mohbey
 
Unit1 and 2 sample solutions
Unit1 and 2 sample solutionsUnit1 and 2 sample solutions
Unit1 and 2 sample solutions
Abha Tripathi
 
teknik tenaga listrik
teknik tenaga listrikteknik tenaga listrik
teknik tenaga listrik
Indra S Wahyudi
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
Nexus
 
petunjuk praktis penelitian ilmiah
petunjuk praktis penelitian ilmiahpetunjuk praktis penelitian ilmiah
petunjuk praktis penelitian ilmiah
Indra S Wahyudi
 
CV_ SHAMBHAVI.doc_ahmdbd
CV_ SHAMBHAVI.doc_ahmdbdCV_ SHAMBHAVI.doc_ahmdbd
CV_ SHAMBHAVI.doc_ahmdbd
Shambhavi Batsa
 
Questions unit2 ch3
Questions unit2 ch3Questions unit2 ch3
Questions unit2 ch3
Abha Tripathi
 
Questions unit3
Questions unit3Questions unit3
Questions unit3
Abha Tripathi
 
Power system and communication network co simulation for smart grid applications
Power system and communication network co simulation for smart grid applicationsPower system and communication network co simulation for smart grid applications
Power system and communication network co simulation for smart grid applications
Indra S Wahyudi
 
Conventional sources of energy (power generation) 01
Conventional sources of energy (power generation) 01Conventional sources of energy (power generation) 01
Conventional sources of energy (power generation) 01
Abha Tripathi
 
Engineering physics 2(Electron Theory of metals)
Engineering physics 2(Electron Theory of metals)Engineering physics 2(Electron Theory of metals)
Engineering physics 2(Electron Theory of metals)
Nexus
 
Unit 2 rangkaian dc
Unit 2  rangkaian dcUnit 2  rangkaian dc
Unit 2 rangkaian dc
Indra S Wahyudi
 
EE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab ManuelEE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab Manuel
Velalar College of Engineering and Technology
 
Unit 1 prinsip dasar listrik
Unit 1 prinsip dasar listrikUnit 1 prinsip dasar listrik
Unit 1 prinsip dasar listrik
Indra S Wahyudi
 
Teknologi sistem pengendalian tenaga listrik berbasis scada
Teknologi sistem pengendalian tenaga listrik berbasis scadaTeknologi sistem pengendalian tenaga listrik berbasis scada
Teknologi sistem pengendalian tenaga listrik berbasis scada
Indra S Wahyudi
 
Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor
Velalar College of Engineering and Technology
 
Questions unit4
Questions unit4Questions unit4
Questions unit4
Abha Tripathi
 
Unit1questions
Unit1questionsUnit1questions
Unit1questions
Abha Tripathi
 

Viewers also liked (19)

Dsp 2marks
Dsp 2marksDsp 2marks
Dsp 2marks
 
Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1
 
Unit1 and 2 sample solutions
Unit1 and 2 sample solutionsUnit1 and 2 sample solutions
Unit1 and 2 sample solutions
 
teknik tenaga listrik
teknik tenaga listrikteknik tenaga listrik
teknik tenaga listrik
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
petunjuk praktis penelitian ilmiah
petunjuk praktis penelitian ilmiahpetunjuk praktis penelitian ilmiah
petunjuk praktis penelitian ilmiah
 
CV_ SHAMBHAVI.doc_ahmdbd
CV_ SHAMBHAVI.doc_ahmdbdCV_ SHAMBHAVI.doc_ahmdbd
CV_ SHAMBHAVI.doc_ahmdbd
 
Questions unit2 ch3
Questions unit2 ch3Questions unit2 ch3
Questions unit2 ch3
 
Questions unit3
Questions unit3Questions unit3
Questions unit3
 
Power system and communication network co simulation for smart grid applications
Power system and communication network co simulation for smart grid applicationsPower system and communication network co simulation for smart grid applications
Power system and communication network co simulation for smart grid applications
 
Conventional sources of energy (power generation) 01
Conventional sources of energy (power generation) 01Conventional sources of energy (power generation) 01
Conventional sources of energy (power generation) 01
 
Engineering physics 2(Electron Theory of metals)
Engineering physics 2(Electron Theory of metals)Engineering physics 2(Electron Theory of metals)
Engineering physics 2(Electron Theory of metals)
 
Unit 2 rangkaian dc
Unit 2  rangkaian dcUnit 2  rangkaian dc
Unit 2 rangkaian dc
 
EE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab ManuelEE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab Manuel
 
Unit 1 prinsip dasar listrik
Unit 1 prinsip dasar listrikUnit 1 prinsip dasar listrik
Unit 1 prinsip dasar listrik
 
Teknologi sistem pengendalian tenaga listrik berbasis scada
Teknologi sistem pengendalian tenaga listrik berbasis scadaTeknologi sistem pengendalian tenaga listrik berbasis scada
Teknologi sistem pengendalian tenaga listrik berbasis scada
 
Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor
 
Questions unit4
Questions unit4Questions unit4
Questions unit4
 
Unit1questions
Unit1questionsUnit1questions
Unit1questions
 

Similar to 5 a4.output

Plsql programs(encrypted)
Plsql programs(encrypted)Plsql programs(encrypted)
Plsql programs(encrypted)
Karunakar Singh Thakur
 
Lab report assembly
Lab report assemblyLab report assembly
Lab report assembly
Syed Ahmed Zaki
 
Plsql
PlsqlPlsql
Data Structure and Algorithm
Data Structure and AlgorithmData Structure and Algorithm
Data Structure and Algorithm
PRIYA DARSHINI A/P VEJAN
 
PLSQL.docx
PLSQL.docxPLSQL.docx
PLSQL.docx
18BF1AO482
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
ab11cs001
 
A10presentationofbiologyandpshyology.pptx
A10presentationofbiologyandpshyology.pptxA10presentationofbiologyandpshyology.pptx
A10presentationofbiologyandpshyology.pptx
ranjangamer007
 
C program report tips
C program report tipsC program report tips
C program report tips
Harry Pott
 
C lab-programs
C lab-programsC lab-programs
C lab-programs
Tony Kurishingal
 
C++
C++C++
c programing
c programingc programing
c programing
bibek lamichhane
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
Neil Mathew
 
C
CC
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
anand hd
 
PL SQL Quiz | PL SQL Examples
PL SQL Quiz |  PL SQL ExamplesPL SQL Quiz |  PL SQL Examples
PL SQL Quiz | PL SQL Examples
Shubham Dwivedi
 
Cpl
CplCpl
Progr3
Progr3Progr3
Progr3
SANTOSH RATH
 
C Programming
C ProgrammingC Programming
C Programming
Rumman Ansari
 
Lab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practiceLab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practice
ranaibrahim453
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
choconyeuquy
 

Similar to 5 a4.output (20)

Plsql programs(encrypted)
Plsql programs(encrypted)Plsql programs(encrypted)
Plsql programs(encrypted)
 
Lab report assembly
Lab report assemblyLab report assembly
Lab report assembly
 
Plsql
PlsqlPlsql
Plsql
 
Data Structure and Algorithm
Data Structure and AlgorithmData Structure and Algorithm
Data Structure and Algorithm
 
PLSQL.docx
PLSQL.docxPLSQL.docx
PLSQL.docx
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
 
A10presentationofbiologyandpshyology.pptx
A10presentationofbiologyandpshyology.pptxA10presentationofbiologyandpshyology.pptx
A10presentationofbiologyandpshyology.pptx
 
C program report tips
C program report tipsC program report tips
C program report tips
 
C lab-programs
C lab-programsC lab-programs
C lab-programs
 
C++
C++C++
C++
 
c programing
c programingc programing
c programing
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
 
C
CC
C
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
 
PL SQL Quiz | PL SQL Examples
PL SQL Quiz |  PL SQL ExamplesPL SQL Quiz |  PL SQL Examples
PL SQL Quiz | PL SQL Examples
 
Cpl
CplCpl
Cpl
 
Progr3
Progr3Progr3
Progr3
 
C Programming
C ProgrammingC Programming
C Programming
 
Lab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practiceLab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practice
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 

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.