Algorithm and flowchart

19,132 views 17 slides Jan 12, 2017
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

To understand algorithm and flowchart, it is better to refer this Slideshare that I have created. I have thoroughly presented the key points that make easy in remembering what algorithm and flowchart is. The slide is really simple and wonderful to use it for a quick reference.


Slide Content

Algorithm and Flowchart 1 Presented by: The Anonymous BSc.CSIT 1 st semester

Content What is algorithm ? Properties of algorithm What is flowchart ? Merits of flowchart Demerits of flowchart Algorithm and Flowchart in Coding References Queries 2

What is an algorithm ? Named after Persian mathematician Mohammad Al-Khwarizmi A sequential solution of any problem Written in human understandable form R equires a clear understanding of the problem 3

Example: 1. Algorithm for sum of two numbers Step 1: Start Step 2: Enter two numbers in a and b Step 3: Add a and b and store in c Step 4: Display c Step 5: End 4

2. Algorithm to check whether the input number is even or odd Step 1: Start Step 2: Enter a number in a Step 3: Check if it is even or odd Step 4: If even print “even” (a mod 2 = 0 ) Step 5: Else print “odd” Step 6: End 5

Properties of algorithm Finiteness Properly defined Input Output Effectiveness Independent to any other programming language 6

7 Now moving on to next programming tool

What is flowchart? Diagrammatic representation of algorithm An important programming tool Solving a problem using figures Different figures having different functions 8

Merits of flowchart Easy to explain program logic Makes coding effective and faster Effective communication Different symbols used Serve as documentation Easy to detect, locate and remove bugs in a program 9

Demerits of Flowchart T ime consuming and monotonous job Difficult to maintain Occupies space while documentation Translation to computer program is difficult 10

11 But what might be the symbols used in flowchart?

Flowchart symbols Symbol Function Description Start/End Start and end point Input/output Input and output operations Processing operation Editing and calculation of data Decision Check logical condition Connector Indicates logical flow from one page to another Direction of logic Direction of flow of logic Comment Indicates any comments for explanatory notes 12

Example 1: Flowchart add sum of two numbers 13 START Input a and b C = a + b Display c END User can enter any two numbers

Example 2: Flowchart to check whether the input number is even or odd 14 START Accept a number Divide it by 2 END Is remainder = 0 ? Display odd Display even Yes No START Accept a number

15 Using Algorithm and Flowchart in Coding Coding Enter numbers in a and b: 5 6 Displayed c: 11

References: Websites: google.com wikipedia.com linkedin.com External sources: Text book: Fundamentals of computer programming 16

Queries 17