a step-by-step procedure for solving a problem in a finite number of steps
TRANSCRIPT
![Page 1: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/1.jpg)
www.btechsmartclass.blogspot.com
Flow Charts & Algorithms
![Page 2: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/2.jpg)
A step-by-step procedure for solving a problem in a finite number of steps.
Algorithm
![Page 3: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/3.jpg)
Problem Statement:
Algorithm Example
Find the sum of natural numbers from 0 to 50
START
IF N <= 50 THEN GOTO Step 4PRINT sumSTOP
Step 1:Step 2:Step 3:Step 4:Step 5:Step 6:Step 7:Step 8:
sum 0N 1sum sum + N N N + 1
![Page 4: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/4.jpg)
Problem Statement:
Algorithm Assignment
Find the sum of any TWO numbers
Problem Statement:Check whether a number given by user is EVEN or ODD
Problem Statement:Find the largest of THREE numbers
![Page 5: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/5.jpg)
Flowchart is a type of diagram that represents an algorithm or process, showing the steps as boxes of various kinds, and their order by connecting them with arrows.
Flow Chart
![Page 6: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/6.jpg)
Terminal Symbol: indicates the starting or stopping point in the logic.
Input/Output Symbol:Represents an input or output process in an algorithm
Process Symbol:Represents any computational step or processing
Decision Symbol:Represents a decision in the logic involving the Comparison Of two values.
Flow Lines
Basic symbols
![Page 7: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/7.jpg)
Basic symbols
![Page 8: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/8.jpg)
www.btechsmartclass.blogspot.com
Three Basic Control Structures
![Page 9: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/9.jpg)
Statemement a
Statemement b
Statemement c
SequenceSequence is a default control structure. Instructions are executed one after another
![Page 10: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/10.jpg)
Selection structure test the condition and then executes one sequence of statements instead of another, depending on whether the condition is true or false
Selection
![Page 11: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/11.jpg)
Condition p?
Statemement a Statemement b
T F
Selection
![Page 12: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/12.jpg)
Condition p?
Statemement a
T
F
Selection
![Page 13: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/13.jpg)
Repetition structure specifies the repetition of an action while some condition remains true. When the conditions of the control statement have been met and control passes to the next statement beyond the repetition structure
Repetition
![Page 14: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/14.jpg)
Condition p?
Statemement block
T
F
Repetition
![Page 15: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/15.jpg)
MAX VALUE1
Print“The largest value is”,
MAX
STOP
Y N
START
InputVALUE1,VALUE2
MAX VALUE2
isVALUE1>VALUE2
Example
![Page 17: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/17.jpg)
Example :largest of three numbers
![Page 18: A step-by-step procedure for solving a problem in a finite number of steps](https://reader038.vdocuments.mx/reader038/viewer/2022110101/56649ef65503460f94c09a7a/html5/thumbnails/18.jpg)
Assignment questions
1.Check a given number is even or not
2.Display even numbers between 10&100