SlideShare a Scribd company logo
1 of 15
COMPUTER
PROGRAMMING
Lecture 04
Prepared By Mr. V. S. Patil Dept (CSE)/AEC
Unit 1 Problem Solving
Syllabus
Prepared By Mr. V. S. Patil Dept (CSE)/AEC
2
1
Understand the logic of algorithm and flow of
control.
Understand the basics symbols of
flowcharts
Objectives
Algorithm
•An algorithm is well defined, finite set of computational
instructions that accomplishes a particular task, which may or
may not take inputs and produces some value or a set of
values as output. In addition all algorithms must satisfy the
following criteria:
1.Zero or more quantities are externally supplied: input
2.At least one quantity is produced: output
3.Each instruction is clear and unambiguous: Definiteness
4.The algorithm terminates after a finite number of steps:
Finiteness
5.For every input instance, it halts with the correct output:
Conventions used in writing Algorithms
•Name of Algorithm
•Introductory Comments
•Steps
•Comments
1
Step 1: [input the three integers]
read x, y, z
.
Step 2: [compute the largest of three numbers]
big = x;
If(y>big) big=y
If(z>big) big=z
Step 3: [Write the largest number]
Write (big)
Step 4: [Finished] exit
Algorithm Development
Ex- Find maximum of 3 numbers. The variables used are:x, y, z : type integer
big : Storing the value of the largest number, type integer
2
3
4
Flowchart
• Definition:- A flowchart is graphical or pictorial
representation of an algorithm.
• It shows the logic of algorithm and flow of control.
• Flowchart uses the symbol to represent the specific
action and arrow to indicate the flow of control.
Basic symbols of flowchart
• Notice there are three types of symbols in this flowchart:
–rounded rectangles
–parallelograms
–a rectangle
• Each symbol represents a different type of operation.
Basic Flowchart Symbols
•Sequence
•Decision
•Repetition
•Case
Four Flowchart Structures
A series of actions are performed in sequence
The pay-calculating example was a sequence flowchart.
Ex.- Write an Flowchart for finding the addition of two number.
Sequence Structure
Decision Structure
•One of two possible actions is taken, depending on a condition.
•A new symbol, the diamond, indicates a yes/no question. If the
answer to the question is yes, the flow follows one path. If the
answer is no, the flow follows another path.
•Ex-
if (x < y)
a = x * 2;
else
a = x + y;
A repetition structure represents part of the program that repeats.
This type of structure is commonly known as a loop.
A loop tests a condition, and if the condition exists, it performs an
action.
Then it tests the condition again. If the condition still exists,
the action is repeated. This continues until the condition no
longer exists.
•Ex- while (x < y)
x++;
Repetition Structure
x < y? Add 1 to
x
YES
Case Structure
One of several possible actions is taken, depending on the
contents of a variable.
Ex- Find maximum of 3 nos
Question Bank
1.What is algorithm?
2. Explain Steps involved in algorithm development with
suitable example.
3.What is flowchart?
4.Describe the symbol of flowcharts.
5.Draw flowchart for Fibonacci Series.

More Related Content

What's hot

Algorithm Design Presentation
Algorithm Design PresentationAlgorithm Design Presentation
Algorithm Design PresentationKawsar Ahmed
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithmsGanesh Solanke
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesFellowBuddy.com
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm designNahid Hasan
 
Lecture 1 objective and course plan
Lecture 1   objective and course planLecture 1   objective and course plan
Lecture 1 objective and course planjayavignesh86
 
Algorithm hierarchy
Algorithm hierarchyAlgorithm hierarchy
Algorithm hierarchyChangyu Yang
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
Array sorting
Array sortingArray sorting
Array sortingALI RAZA
 
Daa presentation 97
Daa presentation 97Daa presentation 97
Daa presentation 97Garima Verma
 
Arrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothiArrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothiSowmya Jyothi
 
Data Structure
Data StructureData Structure
Data Structuresheraz1
 
Algorithm Development
Algorithm DevelopmentAlgorithm Development
Algorithm DevelopmentALI RAZA
 
Kk20503 1 introduction
Kk20503 1 introductionKk20503 1 introduction
Kk20503 1 introductionLow Ying Hao
 
Notion of an algorithm
Notion of an algorithmNotion of an algorithm
Notion of an algorithmNisha Soms
 

What's hot (19)

Algorithm Design Presentation
Algorithm Design PresentationAlgorithm Design Presentation
Algorithm Design Presentation
 
Daa unit 1
Daa unit 1Daa unit 1
Daa unit 1
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm design
 
Amortized analysis
Amortized analysisAmortized analysis
Amortized analysis
 
#1 designandanalysis of algo
#1 designandanalysis of algo#1 designandanalysis of algo
#1 designandanalysis of algo
 
Lecture 1 objective and course plan
Lecture 1   objective and course planLecture 1   objective and course plan
Lecture 1 objective and course plan
 
Sorting
SortingSorting
Sorting
 
Algorithm hierarchy
Algorithm hierarchyAlgorithm hierarchy
Algorithm hierarchy
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Array sorting
Array sortingArray sorting
Array sorting
 
Daa presentation 97
Daa presentation 97Daa presentation 97
Daa presentation 97
 
Arrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothiArrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothi
 
Flow of control
Flow of controlFlow of control
Flow of control
 
Data Structure
Data StructureData Structure
Data Structure
 
Algorithm Development
Algorithm DevelopmentAlgorithm Development
Algorithm Development
 
Kk20503 1 introduction
Kk20503 1 introductionKk20503 1 introduction
Kk20503 1 introduction
 
Notion of an algorithm
Notion of an algorithmNotion of an algorithm
Notion of an algorithm
 

Viewers also liked

COMPUTER PROGRAMMING UNIT 1 Lecture 6
COMPUTER PROGRAMMING UNIT 1 Lecture 6COMPUTER PROGRAMMING UNIT 1 Lecture 6
COMPUTER PROGRAMMING UNIT 1 Lecture 6Vishal Patil
 
COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5Vishal Patil
 
Database system by VISHAL PATIL
Database system by VISHAL PATILDatabase system by VISHAL PATIL
Database system by VISHAL PATILVishal Patil
 
COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1Vishal Patil
 
Important Questions of fourier series with theoretical study Engg. Mathem...
Important Questions  of  fourier series with theoretical study   Engg. Mathem...Important Questions  of  fourier series with theoretical study   Engg. Mathem...
Important Questions of fourier series with theoretical study Engg. Mathem...Mohammad Imran
 
COMPUTER PROGRAMMING UNIT 1 Lecture 3
COMPUTER PROGRAMMING UNIT 1 Lecture 3COMPUTER PROGRAMMING UNIT 1 Lecture 3
COMPUTER PROGRAMMING UNIT 1 Lecture 3Vishal Patil
 
COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2Vishal Patil
 

Viewers also liked (10)

COMPUTER PROGRAMMING UNIT 1 Lecture 6
COMPUTER PROGRAMMING UNIT 1 Lecture 6COMPUTER PROGRAMMING UNIT 1 Lecture 6
COMPUTER PROGRAMMING UNIT 1 Lecture 6
 
COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5COMPUTER PROGRAMMING UNIT 1 Lecture 5
COMPUTER PROGRAMMING UNIT 1 Lecture 5
 
Database system by VISHAL PATIL
Database system by VISHAL PATILDatabase system by VISHAL PATIL
Database system by VISHAL PATIL
 
Research on Data mining at Research Group in Intelligent Systems
Research on Data mining at Research Group in Intelligent SystemsResearch on Data mining at Research Group in Intelligent Systems
Research on Data mining at Research Group in Intelligent Systems
 
COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1
 
Important Questions of fourier series with theoretical study Engg. Mathem...
Important Questions  of  fourier series with theoretical study   Engg. Mathem...Important Questions  of  fourier series with theoretical study   Engg. Mathem...
Important Questions of fourier series with theoretical study Engg. Mathem...
 
COMPUTER PROGRAMMING UNIT 1 Lecture 3
COMPUTER PROGRAMMING UNIT 1 Lecture 3COMPUTER PROGRAMMING UNIT 1 Lecture 3
COMPUTER PROGRAMMING UNIT 1 Lecture 3
 
COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2COMPUTER PROGRAMMING UNIT 1 Lecture 2
COMPUTER PROGRAMMING UNIT 1 Lecture 2
 
Computer Programming- Lecture 5
Computer Programming- Lecture 5 Computer Programming- Lecture 5
Computer Programming- Lecture 5
 
Sucess
SucessSucess
Sucess
 

Similar to COMPUTER PROGRAMMING UNIT 1 Lecture 4

Similar to COMPUTER PROGRAMMING UNIT 1 Lecture 4 (20)

Astu DSA week 1-2.pdf
Astu DSA week 1-2.pdfAstu DSA week 1-2.pdf
Astu DSA week 1-2.pdf
 
matrices_and_loops.pptx
matrices_and_loops.pptxmatrices_and_loops.pptx
matrices_and_loops.pptx
 
Unit 2 algorithm
Unit   2 algorithmUnit   2 algorithm
Unit 2 algorithm
 
Intro To C++ - Class 09 - Control Statements: Part 1
Intro To C++ - Class 09 - Control Statements: Part 1Intro To C++ - Class 09 - Control Statements: Part 1
Intro To C++ - Class 09 - Control Statements: Part 1
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 
lab-8 (1).pptx
lab-8 (1).pptxlab-8 (1).pptx
lab-8 (1).pptx
 
Flowchart
FlowchartFlowchart
Flowchart
 
Slide 6_Control Structures.pdf
Slide 6_Control Structures.pdfSlide 6_Control Structures.pdf
Slide 6_Control Structures.pdf
 
Chapter1.1 Introduction.ppt
Chapter1.1 Introduction.pptChapter1.1 Introduction.ppt
Chapter1.1 Introduction.ppt
 
Chapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.pptChapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.ppt
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
ALGO VS FLOW.pptx
ALGO VS FLOW.pptxALGO VS FLOW.pptx
ALGO VS FLOW.pptx
 
Flowcharting week 5 2019 2020
Flowcharting week 5  2019  2020Flowcharting week 5  2019  2020
Flowcharting week 5 2019 2020
 
Simplex Algorithm
Simplex AlgorithmSimplex Algorithm
Simplex Algorithm
 
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptxCH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptx
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 

COMPUTER PROGRAMMING UNIT 1 Lecture 4

  • 1. COMPUTER PROGRAMMING Lecture 04 Prepared By Mr. V. S. Patil Dept (CSE)/AEC
  • 2. Unit 1 Problem Solving Syllabus Prepared By Mr. V. S. Patil Dept (CSE)/AEC
  • 3. 2 1 Understand the logic of algorithm and flow of control. Understand the basics symbols of flowcharts Objectives
  • 4. Algorithm •An algorithm is well defined, finite set of computational instructions that accomplishes a particular task, which may or may not take inputs and produces some value or a set of values as output. In addition all algorithms must satisfy the following criteria: 1.Zero or more quantities are externally supplied: input 2.At least one quantity is produced: output 3.Each instruction is clear and unambiguous: Definiteness 4.The algorithm terminates after a finite number of steps: Finiteness 5.For every input instance, it halts with the correct output:
  • 5. Conventions used in writing Algorithms •Name of Algorithm •Introductory Comments •Steps •Comments
  • 6. 1 Step 1: [input the three integers] read x, y, z . Step 2: [compute the largest of three numbers] big = x; If(y>big) big=y If(z>big) big=z Step 3: [Write the largest number] Write (big) Step 4: [Finished] exit Algorithm Development Ex- Find maximum of 3 numbers. The variables used are:x, y, z : type integer big : Storing the value of the largest number, type integer 2 3 4
  • 7. Flowchart • Definition:- A flowchart is graphical or pictorial representation of an algorithm. • It shows the logic of algorithm and flow of control. • Flowchart uses the symbol to represent the specific action and arrow to indicate the flow of control.
  • 8. Basic symbols of flowchart
  • 9. • Notice there are three types of symbols in this flowchart: –rounded rectangles –parallelograms –a rectangle • Each symbol represents a different type of operation. Basic Flowchart Symbols
  • 11. A series of actions are performed in sequence The pay-calculating example was a sequence flowchart. Ex.- Write an Flowchart for finding the addition of two number. Sequence Structure
  • 12. Decision Structure •One of two possible actions is taken, depending on a condition. •A new symbol, the diamond, indicates a yes/no question. If the answer to the question is yes, the flow follows one path. If the answer is no, the flow follows another path. •Ex- if (x < y) a = x * 2; else a = x + y;
  • 13. A repetition structure represents part of the program that repeats. This type of structure is commonly known as a loop. A loop tests a condition, and if the condition exists, it performs an action. Then it tests the condition again. If the condition still exists, the action is repeated. This continues until the condition no longer exists. •Ex- while (x < y) x++; Repetition Structure x < y? Add 1 to x YES
  • 14. Case Structure One of several possible actions is taken, depending on the contents of a variable. Ex- Find maximum of 3 nos
  • 15. Question Bank 1.What is algorithm? 2. Explain Steps involved in algorithm development with suitable example. 3.What is flowchart? 4.Describe the symbol of flowcharts. 5.Draw flowchart for Fibonacci Series.