Skip to main content
  1. Study/
  2. Computer Programming/
  3. Logic and Algorithms/

Logic and Algorithm #03: Flowchart

·2 mins· loading · loading ·
Azriel Fidzlie
Author
Azriel Fidzlie
Hello, my name is Azriel Fidzlie 👋. I am a {full-stack} developer, student, and {designer} who lives for enjoying a cup of tea 24/7 ☕️.
Table of Contents
Logic and Algorithms Chapters - This article is part of a series.
Part 3: This Article

It is a diagram that describes the logical arrangement of a program. The symbols used are as follows:

SymbolSymbol NameDescription
image
Terminalas the beginning (contains ‘Start’) and as the end (contains ‘End’/‘Stop’).
image
Input/OutputReads input or displays output.
image
Process/ProcessingProcesses data through arithmetic and logical operations.
image
Decision/(decision box)Functions to decide the direction/branch taken according to the fulfilled condition, namely True/False.
image
Subroutine/subprogramTo execute the process of a part (subprogram) or procedure.
image
On page Connectorto connect a disconnected flowchart where the part is still on the same page.
image
Flowline/Data flowThe direction part of the executed instruction.
image
Off page ConnectorConnects a connection from a disconnected flowchart part where the connection is on another page.
image
PreparationUsed for initial value assignment.

Computer Program Flowchart
#

Basically a computer program generally consists of:

  1. Reading / entering data into the computer
  2. Performing computation/calculation on the data
  3. Outputting / printing/ displaying the results.

Flowchart consists of three structures
#

  1. Sequence Structure / Simple Structure Used for programs whose instructions are sequential
image

Example of Sequence Structure Flowchart Calculating Triangle Area
#

image

Using Storage Tables
#

Table 1. Sequence Storage Media 1

CommandABOutput
A <- 1010
A <- 2*A20
B <- A20
Write(B)20

Table 2. Sequence Storage Media 2

CommandXYZOutput
X <- 100100
Y <- X-2575
Z <- Y/515
X <- X/(Z+5)5
Write(X,Y,Z)

Summing Two Positive Numbers
#

Create a flowchart to sum two positive integers and print the result. The algorithm:

  • Enter number a
  • Enter number b
  • Sum numbers a and b
  • Print the sum result
image

Determining Even/Odd Numbers
#

Branching Structure Used for programs that use condition selection. (example determining even/odd numbers)

image

The algorithm:

  1. Enter a number
  2. Divide the number by 2
  3. If the remainder of the division = 0 then the number is an even number
  4. If the remainder of the division = 1 then the number is an odd number

Pseudocode:

read number
If number mod 2 = 0 then
“Even Number”
Else
“Odd Number”
image

Looping Flowchart
#

Looping Structure Used for programs whose instructions will be executed repeatedly.

image
Logic and Algorithms Chapters - This article is part of a series.
Part 3: This Article

Related