SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Algorithm and Flowchart
Dhanik Mahehswari
dhanikvikrant@gmail.com
Civil engineering department
QUEST Nawabshah
 In order to solve any problem by using computer, it is
very imperative to
 Detail the precise problem
 Itemizing the configuration
 The process of solving problem is known as “Problem
analysis”
Problem Solving Stages
 A problem solving process consists of eight stages as:
 Defining the problem
 Algorithm
 Flowchart
 Coding
 Input Preparation
 Compilation
 Debugging
 Testing
 This step has a great importance in obtaining the correct
solution of the problem
 The solution of the problem depends upon the description
and understanding the problem.
 This requires analysis of the problem to find the nature of
the problem analysis of the input data and planning of the
output result.
 This step achieves following goals:
Defining the Problem
 Problem description
 Determination of the objective
 Analysis of the input data
 Planning of output
 Series of procedural steps required to solve a given problem
is called an algorithm.
 The construction of the algorithm is the stage which requires
steps or operations which collectively solve 'a given problem.
 An algorithm usually is in ordinary English language and use
some mathematical symbols, if it is possible to solve a given
problem in more than one ways
 The choice of particular algorithm depends upon various
such as its reliability, accuracy and ease of modification.
Algorithm
 One of the most important factor in the choice of an
algorithm is the time requirement to execute it (after it in
high level language) with the help of computer.
 The algorithm which will least time when executed by a
computer is considered the best.
 Write an algorithm to print given roll number and name.
 Step 1: Enter Roll number
 Step 2: Enter Name
 Step 3: Print Roll number
 Step 4: Print name
 Step 5: Stop
EXAMPLE 01
 Write an algorithm to print the first ten natural numbers.
 Step-I: Select a counter A
 Step-2: Initialize A as zero
 Step-3: Add 1 to A
 Step-4: Print A
 Step-5: If A <10 then go to step-3
 Step-6: Stop
EXAMPLE 02
 Write an algorithm to print the greatest number from two
given numbers.
 Step-I: Enter two numbers as A and B
 Step-2: If A > B then Print A and go to step 4
 Step-3: Print B
 Step-4: Stop
EXAMPLE 03
 Write an algorithm to print a table of a given number
 Step-1: Select two counters as B and C
 Step-2: Initialize the counters B and C as zero
 Step-3: Enter a, number of table as A
 Step-4: Add 1 to B
 Step-5: Multiply A to B and assign the result to C
 Step-6: Print A; B and C
 Step-7: Check the value of B; If B<1O then go to step-4
 Step-8: Stop
EXAMPLE 04
 Write-an algorithm to print square and cubes from 1 to 5
 Step-1: Select the counter A, B and C
 Step-2: Initialize B and C as zero
 Step-3: Initialize A as 1
 Step-4: Calculate B as A*A
 Step-5: Calculate C as A*A*A
 Step-6: Print A, B, and C.
 Step-7: Add 1 to A
 Step-8: Check the value of A; if A < 5 then go to step-3
 Step-9: Stop
EXAMPLE 05
 A flowchart is a pictorial representation of the steps of a
involved in the procedure of solving any problem.
 The first formal flowchart was designed by John Von
Neumann‘
 A flowchart is drawn before the program in written to
ensure the instructions will be logically integrated.
 A flowchart is not a complete program but It is an aid to
programming.
FLOWCHART
 There are two types of flowchart, which are
 System Flowchart
 Program Flowchart
 A system flowchart shows the flow of data throughout a
data process as well as the flow into and out system. The
system analyst will use such a design and to explain a
data processing system.
 Program flowchart is a pictorial representation of the
method and sequence, to be followed for solving a
particular problem.
 There are several sets of the symbols, which are
standardized by American National Standard Institute
International Standard Organization (ISO) to draw the
flowchart.
 Most commonly used symbols are Oval, Parallelogram,
Rectangle, Diamond, Arrows, Connectors.
 Oval
 This ‘symbol' is used for beginning or end of a flowchart.
Therefore, it is also named as “TERMINAL”
Start/End
 PARALLELOGRAM:
 This symbol is used for transfer of data between Central
Processing Unit (CPU) output devices.
 In the simple words we can say this symbol is used to
represent and output operations.
 Therefore, it is also known as INPUT/OUTPUT box.
INPUT/
OUTPUT
 RECTANGLE:
 This symbol is used to represent any arithmetic operation
or transfer of data.
 This symbol is also known as PROCESS box.
PROCESS
 DIAMOND:
 This symbol is used to test the condition or to ask
question and on the their answers that decide a definite
path from a number of alternatives
 This symbols is also known as DECISION BOX.
 ARROWS:
 This symbol is used to show the direction of the flow
 In a flowchart every line must have an arrow to indicate
 CONNECTORS:
 Connectors are used to join the different parts of a
flowchart.
 The use of connectors gives neat shape to the flowchart.
there are two types of connector which are known as:
(a) On page connector
(b) Off page connector
 (a) On Page Connector
 On page Connector is represented by small circles.
 In a flowchart whenever complexity in branching arises,
this connectors used to connect one process with an
other place
 (b) Off Page Connector
 This symbol is used for off page Connector.
 In a complicated problem, flowchart may run into several
pages. The part of the flowchart on different pages is
connected with the help of Off Page Connector.
 Write a program to read a number from
keyboard, calculate the square of the
number and display it on the screen.
 1: Beginning of the program
 2: Read the number from the keyboard
 3: Calculate square of the Number
 4: Print the Square of the Number
 5: Stop
END
START
READ
Number
CALCULATE
(Number)2
PRINT
(Number)2
EXAMPLE 01
 Write a program to reads a number from
keyboard, checks; whether number is positive
or negative, if the number is positive it is
printed as it , If number is negative then
absolute value of the number is printed.
 1. Beginning of program.
 2. Read the number from the keyboard.
 3. If N >0, go to step 7
 4. Determine absolute value of N and assign
the resulting value to A, go
 5. Assigning the value of N to A
 6: Print the value of A
 7. End of program.
EXAMPLE 02 START
INPUT
N
PRINT
A
N = |N|
NO
IF
N ≥ 0
A = N
YES
B
START
B
 Draw flowchart to print given roll number and name.
 Draw flowchart to print the first ten natural numbers.
 Draw flowchart to print the greatest number from two
given numbers.
 Draw flowchart to print a table of a given number
 Draw flowchart to print square and cubes from 1 to 5
EXERCISE
 Draw flowchart to solve equation ax+b=0. Execute
flowchart using following data (i) a=3, b=6 (ii) a=0, b=52
 Draw flowchart to convert given temperature in Celsius
scale into Fahrenheit scale (i) 20oC (ii) 40oC (iii) 0oC
Flowchart and algorithm

Weitere ähnliche Inhalte

Was ist angesagt?

2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problemFrankie Jones
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSURBHI SAROHA
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartSachin Goyani
 
pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and FlowchartALI RAZA
 
Algorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodesAlgorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodesSatveer Mann
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
Lecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesLecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesRajesh K Shukla
 
Algorithms and flowcharts by Haseeb Khan
Algorithms and flowcharts by Haseeb KhanAlgorithms and flowcharts by Haseeb Khan
Algorithms and flowcharts by Haseeb KhanHaseeb Shalmani
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C LanguageAryan Ajmer
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?Angela DeHart
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using ComputerDavid Livingston J
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow chartsPraveen M Jigajinni
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowchartsnicky_walters
 
pseudo code basics
pseudo code basicspseudo code basics
pseudo code basicsSabik T S
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithmsStudent
 

Was ist angesagt? (20)

2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
 
pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and Flowchart
 
Algorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodesAlgorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodes
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Lecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesLecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its Properties
 
Algorithms and flowcharts by Haseeb Khan
Algorithms and flowcharts by Haseeb KhanAlgorithms and flowcharts by Haseeb Khan
Algorithms and flowcharts by Haseeb Khan
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C Language
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?
 
ppt of flowchart
ppt of flowchartppt of flowchart
ppt of flowchart
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
Qbasic Tutorial
Qbasic TutorialQbasic Tutorial
Qbasic Tutorial
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowcharts
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
pseudo code basics
pseudo code basicspseudo code basics
pseudo code basics
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithms
 

Ähnlich wie Flowchart and algorithm

AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfSusieMaestre1
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.NandiniSidana
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfAmanPratik11
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptReshuReshma8
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowchartsmoazwinner
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMRc Os
 
flowchart & algorithms
flowchart & algorithmsflowchart & algorithms
flowchart & algorithmsStudent
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sitSaurabh846965
 
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.pptLecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.pptcosc242101003
 
Psuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptxPsuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptxMattFlordeliza1
 
Algorithm and flowchart.pptx
Algorithm and flowchart.pptxAlgorithm and flowchart.pptx
Algorithm and flowchart.pptxMaheShiva
 
ALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTSALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTSKate Campbell
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer scienceumardanjumamaiwada
 

Ähnlich wie Flowchart and algorithm (20)

AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdf
 
Practical 01 (detailed)
Practical 01 (detailed)Practical 01 (detailed)
Practical 01 (detailed)
 
Chap6
Chap6Chap6
Chap6
 
Cp module 2
Cp module 2Cp module 2
Cp module 2
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdf
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
 
Flowcharting and Algorithm
Flowcharting and Algorithm Flowcharting and Algorithm
Flowcharting and Algorithm
 
Flowcharts
FlowchartsFlowcharts
Flowcharts
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
 
flowchart & algorithms
flowchart & algorithmsflowchart & algorithms
flowchart & algorithms
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
 
Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3
 
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.pptLecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
 
Psuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptxPsuedocode1, algorithm1, Flowchart1.pptx
Psuedocode1, algorithm1, Flowchart1.pptx
 
Algorithm and flowchart.pptx
Algorithm and flowchart.pptxAlgorithm and flowchart.pptx
Algorithm and flowchart.pptx
 
ALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTSALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTS
 
lecture 5
 lecture 5 lecture 5
lecture 5
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 

Kürzlich hochgeladen

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 

Kürzlich hochgeladen (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 

Flowchart and algorithm

  • 1. Algorithm and Flowchart Dhanik Mahehswari dhanikvikrant@gmail.com Civil engineering department QUEST Nawabshah
  • 2.  In order to solve any problem by using computer, it is very imperative to  Detail the precise problem  Itemizing the configuration  The process of solving problem is known as “Problem analysis” Problem Solving Stages
  • 3.  A problem solving process consists of eight stages as:  Defining the problem  Algorithm  Flowchart  Coding  Input Preparation  Compilation  Debugging  Testing
  • 4.  This step has a great importance in obtaining the correct solution of the problem  The solution of the problem depends upon the description and understanding the problem.  This requires analysis of the problem to find the nature of the problem analysis of the input data and planning of the output result.  This step achieves following goals: Defining the Problem
  • 5.  Problem description  Determination of the objective  Analysis of the input data  Planning of output
  • 6.  Series of procedural steps required to solve a given problem is called an algorithm.  The construction of the algorithm is the stage which requires steps or operations which collectively solve 'a given problem.  An algorithm usually is in ordinary English language and use some mathematical symbols, if it is possible to solve a given problem in more than one ways  The choice of particular algorithm depends upon various such as its reliability, accuracy and ease of modification. Algorithm
  • 7.  One of the most important factor in the choice of an algorithm is the time requirement to execute it (after it in high level language) with the help of computer.  The algorithm which will least time when executed by a computer is considered the best.
  • 8.  Write an algorithm to print given roll number and name.  Step 1: Enter Roll number  Step 2: Enter Name  Step 3: Print Roll number  Step 4: Print name  Step 5: Stop EXAMPLE 01
  • 9.  Write an algorithm to print the first ten natural numbers.  Step-I: Select a counter A  Step-2: Initialize A as zero  Step-3: Add 1 to A  Step-4: Print A  Step-5: If A <10 then go to step-3  Step-6: Stop EXAMPLE 02
  • 10.  Write an algorithm to print the greatest number from two given numbers.  Step-I: Enter two numbers as A and B  Step-2: If A > B then Print A and go to step 4  Step-3: Print B  Step-4: Stop EXAMPLE 03
  • 11.  Write an algorithm to print a table of a given number  Step-1: Select two counters as B and C  Step-2: Initialize the counters B and C as zero  Step-3: Enter a, number of table as A  Step-4: Add 1 to B  Step-5: Multiply A to B and assign the result to C  Step-6: Print A; B and C  Step-7: Check the value of B; If B<1O then go to step-4  Step-8: Stop EXAMPLE 04
  • 12.  Write-an algorithm to print square and cubes from 1 to 5  Step-1: Select the counter A, B and C  Step-2: Initialize B and C as zero  Step-3: Initialize A as 1  Step-4: Calculate B as A*A  Step-5: Calculate C as A*A*A  Step-6: Print A, B, and C.  Step-7: Add 1 to A  Step-8: Check the value of A; if A < 5 then go to step-3  Step-9: Stop EXAMPLE 05
  • 13.  A flowchart is a pictorial representation of the steps of a involved in the procedure of solving any problem.  The first formal flowchart was designed by John Von Neumann‘  A flowchart is drawn before the program in written to ensure the instructions will be logically integrated.  A flowchart is not a complete program but It is an aid to programming. FLOWCHART
  • 14.  There are two types of flowchart, which are  System Flowchart  Program Flowchart  A system flowchart shows the flow of data throughout a data process as well as the flow into and out system. The system analyst will use such a design and to explain a data processing system.
  • 15.  Program flowchart is a pictorial representation of the method and sequence, to be followed for solving a particular problem.  There are several sets of the symbols, which are standardized by American National Standard Institute International Standard Organization (ISO) to draw the flowchart.  Most commonly used symbols are Oval, Parallelogram, Rectangle, Diamond, Arrows, Connectors.
  • 16.  Oval  This ‘symbol' is used for beginning or end of a flowchart. Therefore, it is also named as “TERMINAL” Start/End
  • 17.  PARALLELOGRAM:  This symbol is used for transfer of data between Central Processing Unit (CPU) output devices.  In the simple words we can say this symbol is used to represent and output operations.  Therefore, it is also known as INPUT/OUTPUT box. INPUT/ OUTPUT
  • 18.  RECTANGLE:  This symbol is used to represent any arithmetic operation or transfer of data.  This symbol is also known as PROCESS box. PROCESS
  • 19.  DIAMOND:  This symbol is used to test the condition or to ask question and on the their answers that decide a definite path from a number of alternatives  This symbols is also known as DECISION BOX.
  • 20.  ARROWS:  This symbol is used to show the direction of the flow  In a flowchart every line must have an arrow to indicate
  • 21.  CONNECTORS:  Connectors are used to join the different parts of a flowchart.  The use of connectors gives neat shape to the flowchart. there are two types of connector which are known as: (a) On page connector (b) Off page connector
  • 22.  (a) On Page Connector  On page Connector is represented by small circles.  In a flowchart whenever complexity in branching arises, this connectors used to connect one process with an other place
  • 23.  (b) Off Page Connector  This symbol is used for off page Connector.  In a complicated problem, flowchart may run into several pages. The part of the flowchart on different pages is connected with the help of Off Page Connector.
  • 24.  Write a program to read a number from keyboard, calculate the square of the number and display it on the screen.  1: Beginning of the program  2: Read the number from the keyboard  3: Calculate square of the Number  4: Print the Square of the Number  5: Stop END START READ Number CALCULATE (Number)2 PRINT (Number)2 EXAMPLE 01
  • 25.  Write a program to reads a number from keyboard, checks; whether number is positive or negative, if the number is positive it is printed as it , If number is negative then absolute value of the number is printed.  1. Beginning of program.  2. Read the number from the keyboard.  3. If N >0, go to step 7  4. Determine absolute value of N and assign the resulting value to A, go  5. Assigning the value of N to A  6: Print the value of A  7. End of program. EXAMPLE 02 START INPUT N PRINT A N = |N| NO IF N ≥ 0 A = N YES B START B
  • 26.  Draw flowchart to print given roll number and name.  Draw flowchart to print the first ten natural numbers.  Draw flowchart to print the greatest number from two given numbers.  Draw flowchart to print a table of a given number  Draw flowchart to print square and cubes from 1 to 5 EXERCISE
  • 27.  Draw flowchart to solve equation ax+b=0. Execute flowchart using following data (i) a=3, b=6 (ii) a=0, b=52  Draw flowchart to convert given temperature in Celsius scale into Fahrenheit scale (i) 20oC (ii) 40oC (iii) 0oC