SlideShare a Scribd company logo
Introduction to computers
and Computing
Flow Charts
A schematic representation of sequence of
operations to achieve a task.
 Also called “Flow Diagram” or “Flow
Sheet”
This helps us to show the flow of program
graphically.
How to represent using Flow Chart?
There are certain symbols that are connected together
to form a complete Flow Chart for a particular problem
These symbols represent:
1. Start/End
2. Read/Print (Input/Output)
3. Arithmetic operations
4. Conditions
5. Connectors
6. Flow line
of the program
How to represent using Flow Chart?
(Contd.)
 This sign represents a limitation.
 It shows where the program starts, and where it ends.
START END
The Oval.
How to represent using Flow Chart?
(Contd.)
A PARALLELOGRAM
This sign represents an Input or an Output.
READ PRINT
How to represent using Flow Chart?
(Contd.)
A RECTANGLE.
S = a + b
 This is where we want to show an arithmetic
function
(+,-,*,/,^), or to give a number or a string it's value.
NOTE: You must never write for example "a + b = s"
How to represent using Flow Chart?
(Contd.)
A Square
condition
yes
No
 This represents a condition.
 Inside we write the condition, and if that condition is true,
then the flow branches to “YES” else to “NO”.
NOTE: This sign must always have two exits: "YES", if the
condition is fulfilled and "NO", if the condition is not
fulfilled.
How to represent using Flow Chart?
(Contd.)
 These are the flow lines.
 They connect various blocks in a Flow Chart.
How to represent using Flow Chart?
(Contd.)
 These are the connectors.
 They connects portion of algorithm and inside
use of start and end symbols.
Module
Flow Chart
Algorithms are more easily understood if they mainly
use self-contained modules and
1-Sequence logic or Sequential flow
2-Selection logic or Conditional flow
3-Iterative logic or Repetitive flow
Sequence logic (Sequential flow)
Sequence logic are executed in the obvious
sequence. The sequence may be presented
explicitly, by means of numbered steps, or
implicitly , by the order in which the module are
written.
Module A
Module B
Module C
Selection Logic (Conditional Flow)
Selection logic employs a number of conditions which lead
to a selection of one out of several alternative
modules. The structures which implement this logic are
called selection structures.
These selection structures fall into three types.
 Single selection ( If structure )
 Double selection ( If/else structure)
 Multiple selection ( if/else if / else or Switch
structure )
Selection Logic (Conditional Flow)
Single selection:
The logic of this structure is, If the
condition holds, then Module A , which
may consist of one or more statements is
executed ; otherwise Module A is skipped
and control transfers to the next step of
the algorithm.
Selection Logic (Conditional Flow)
Single Selection:
Condition ?
Module A
Yes
No
Selection Logic (Conditional Flow)
Double selection:
Condition ?
Module A Module B
No
Yes
PSEUDOCODE – Execution of if-
then-else
Multiple selection :
F
T
Break
T
Break
T
Break
F
.
.
.
F
Iterative Logic (Repetitive Flow)
The third kind of logic refers to either of two
types of structures involving loops. Each
type begins with a repeat statement and is
followed by a module ,called the body of
the loop.
1-While structure
2-For Structure
Iterative Logic (Repetitive Flow)
While Structure :
Condition ?
Module
(body of loop)
No
Yes
Iterative Logic (Repetitive Flow)
For Structure :
KR
Is K > S ?
Module
(body of loop)
KK+T
No
Yes
Example – Add two numbers, calculate &
print the sum.
A Flow Chart
Start
End
READ a, b
S := a + b
Print S
Impact of the computer language
 An algorithm is expressed in abstract terms.
 To be intelligible to a computer, it needs to be
expressed in a language understood by it.
 The only language really understood by a
computer is its own machine language.
 Programs expressed in the machine language
are said to be executable.
 A program written in any other language needs
to be first translated to the machine language
before it can be executed.
 A machine language is far too cryptic to be
suitable for the direct use of
programmers.
 A further abstraction of this language is
the assembly language which provides
mnemonic names for the instructions and
a more intelligible notation for the data.
 An assembly language program is
translated to machine language by a
translator called an assembler
 Even assembly languages are difficult to work
with.
 High-level languages such as C provide a much
more convenient notation for implementing
algorithms.
 They liberate programmers from having to think
in very low-level terms, and help them to focus
on the algorithm instead.
 A program written in a high-level language is
translated to assembly language by a translator
called a compiler.
 The assembly code produced by the compiler is
then assembled to produce an executable
program.
A Simple C Program
 #include <iostream.h>
 int main (void)
 {
 printf("Hello Worldn“);
 }
Annotation for the simple c program
 This line uses the preprocessor
directive #include to include the contents
of the header file iostream.h in the
program. Iostream.h is a standard C++
header file and contains definitions for
input and output.
Cont…
 This line defines a function called main.
 A function may have zero or more parameters;
these always appear after the function name,
between a pair of brackets.
 The word void appearing between the brackets
indicates that main has no parameters.
 A function may also have a return type; this
always appears before the function name.
 The return type for main is int (i.e., an integer
number).
 All C++ programs must have exactly one main
function. Program execution always begins from
main.
Cont…
 This brace marks the beginning of the body of
main.
 This line is a statement.
 A statement is a computation step which may
produce a value.
 The end of a statement is always marked with a
semicolon (;).
 This statement causes the string "Hello Worldn"
to be sent to the printf output stream.
 A string is any sequence of characters enclosed
in double-quotes.
 The last character in this string (n) is a newline
character which is similar to a carriage return on
a type writer.
 This brace marks the end of the body of
main.
Variable
 A variable is a symbolic name for a memory
location in which data can be stored and
subsequently recalled.
 Variables are used for holding data values so that
they can be utilized in various computations in a
program.
 All variables have two important attributes:
 A type which is established when the variable is
defined (e.g., integer, real, character). Once defined, the
type of a C variable cannot be changed.
 A value which can be changed by assigning a new
value to the variable. The kind of values a variable can
assume depends on its type. For example, an integer
variable can only take integer values (e.g., 2, 100, -12).

More Related Content

PDF
Algorithm and c language
PPTX
Computer programming and utilization
PPT
Lect 3-4 Zaheer Abbas
PPTX
1.0 Introduction to C programming for all first year courses.pptx
PDF
Cp module 2
PPT
Unit 1 c - all topics
PPSX
Complete C++ programming Language Course
PPTX
LESSON 6-Computer programming control structure 1
Algorithm and c language
Computer programming and utilization
Lect 3-4 Zaheer Abbas
1.0 Introduction to C programming for all first year courses.pptx
Cp module 2
Unit 1 c - all topics
Complete C++ programming Language Course
LESSON 6-Computer programming control structure 1

Similar to Flowcharts and Introduction to computers (20)

PPTX
UNIT 1.pptx Programming for Problem Solving
PPTX
Programming in C by SONU KUMAR.pptx
PPTX
CSE 1201: Structured Programming Language
PDF
c_programming.pdf
PPTX
Cs1123 2 comp_prog
PPTX
Full Basic Programming in c material ppt
PPT
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
PPS
Learn C
PPTX
Algorithms - Introduction to computer programming
PPTX
C language
PPTX
basics of c programming for naiver.pptx
PPTX
C programming slide day 01 uploadd by md abdullah al shakil
PPTX
Dr Mrs A A Miraje C Programming PPT.pptx
PPTX
Lec01-02 (Topic 1 C++ Fundamentals).pptx
PDF
C Programming Lab - Session 1 - Flowcharts for Programs
PPTX
Introduction to c
PPT
Unit1 C
PPT
Unit1 C
PPSX
Session1 c1
PPTX
UNIT 1.pptx Programming for Problem Solving
Programming in C by SONU KUMAR.pptx
CSE 1201: Structured Programming Language
c_programming.pdf
Cs1123 2 comp_prog
Full Basic Programming in c material ppt
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
Learn C
Algorithms - Introduction to computer programming
C language
basics of c programming for naiver.pptx
C programming slide day 01 uploadd by md abdullah al shakil
Dr Mrs A A Miraje C Programming PPT.pptx
Lec01-02 (Topic 1 C++ Fundamentals).pptx
C Programming Lab - Session 1 - Flowcharts for Programs
Introduction to c
Unit1 C
Unit1 C
Session1 c1
Ad

Recently uploaded (20)

PDF
Classroom Observation Tools for Teachers
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Insiders guide to clinical Medicine.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Lesson notes of climatology university.
PDF
01-Introduction-to-Information-Management.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Pre independence Education in Inndia.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Institutional Correction lecture only . . .
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Structure & Organelles in detailed.
Classroom Observation Tools for Teachers
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Computing-Curriculum for Schools in Ghana
Renaissance Architecture: A Journey from Faith to Humanism
Insiders guide to clinical Medicine.pdf
Sports Quiz easy sports quiz sports quiz
Module 4: Burden of Disease Tutorial Slides S2 2025
Lesson notes of climatology university.
01-Introduction-to-Information-Management.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Supply Chain Operations Speaking Notes -ICLT Program
102 student loan defaulters named and shamed – Is someone you know on the list?
GDM (1) (1).pptx small presentation for students
Pre independence Education in Inndia.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Institutional Correction lecture only . . .
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Structure & Organelles in detailed.
Ad

Flowcharts and Introduction to computers

  • 2. Flow Charts A schematic representation of sequence of operations to achieve a task.  Also called “Flow Diagram” or “Flow Sheet” This helps us to show the flow of program graphically.
  • 3. How to represent using Flow Chart? There are certain symbols that are connected together to form a complete Flow Chart for a particular problem These symbols represent: 1. Start/End 2. Read/Print (Input/Output) 3. Arithmetic operations 4. Conditions 5. Connectors 6. Flow line of the program
  • 4. How to represent using Flow Chart? (Contd.)  This sign represents a limitation.  It shows where the program starts, and where it ends. START END The Oval.
  • 5. How to represent using Flow Chart? (Contd.) A PARALLELOGRAM This sign represents an Input or an Output. READ PRINT
  • 6. How to represent using Flow Chart? (Contd.) A RECTANGLE. S = a + b  This is where we want to show an arithmetic function (+,-,*,/,^), or to give a number or a string it's value. NOTE: You must never write for example "a + b = s"
  • 7. How to represent using Flow Chart? (Contd.) A Square condition yes No  This represents a condition.  Inside we write the condition, and if that condition is true, then the flow branches to “YES” else to “NO”. NOTE: This sign must always have two exits: "YES", if the condition is fulfilled and "NO", if the condition is not fulfilled.
  • 8. How to represent using Flow Chart? (Contd.)  These are the flow lines.  They connect various blocks in a Flow Chart.
  • 9. How to represent using Flow Chart? (Contd.)  These are the connectors.  They connects portion of algorithm and inside use of start and end symbols. Module
  • 10. Flow Chart Algorithms are more easily understood if they mainly use self-contained modules and 1-Sequence logic or Sequential flow 2-Selection logic or Conditional flow 3-Iterative logic or Repetitive flow
  • 11. Sequence logic (Sequential flow) Sequence logic are executed in the obvious sequence. The sequence may be presented explicitly, by means of numbered steps, or implicitly , by the order in which the module are written. Module A Module B Module C
  • 12. Selection Logic (Conditional Flow) Selection logic employs a number of conditions which lead to a selection of one out of several alternative modules. The structures which implement this logic are called selection structures. These selection structures fall into three types.  Single selection ( If structure )  Double selection ( If/else structure)  Multiple selection ( if/else if / else or Switch structure )
  • 13. Selection Logic (Conditional Flow) Single selection: The logic of this structure is, If the condition holds, then Module A , which may consist of one or more statements is executed ; otherwise Module A is skipped and control transfers to the next step of the algorithm.
  • 14. Selection Logic (Conditional Flow) Single Selection: Condition ? Module A Yes No
  • 15. Selection Logic (Conditional Flow) Double selection: Condition ? Module A Module B No Yes
  • 16. PSEUDOCODE – Execution of if- then-else Multiple selection : F T Break T Break T Break F . . . F
  • 17. Iterative Logic (Repetitive Flow) The third kind of logic refers to either of two types of structures involving loops. Each type begins with a repeat statement and is followed by a module ,called the body of the loop. 1-While structure 2-For Structure
  • 18. Iterative Logic (Repetitive Flow) While Structure : Condition ? Module (body of loop) No Yes
  • 19. Iterative Logic (Repetitive Flow) For Structure : KR Is K > S ? Module (body of loop) KK+T No Yes
  • 20. Example – Add two numbers, calculate & print the sum. A Flow Chart Start End READ a, b S := a + b Print S
  • 21. Impact of the computer language  An algorithm is expressed in abstract terms.  To be intelligible to a computer, it needs to be expressed in a language understood by it.  The only language really understood by a computer is its own machine language.  Programs expressed in the machine language are said to be executable.  A program written in any other language needs to be first translated to the machine language before it can be executed.
  • 22.  A machine language is far too cryptic to be suitable for the direct use of programmers.  A further abstraction of this language is the assembly language which provides mnemonic names for the instructions and a more intelligible notation for the data.  An assembly language program is translated to machine language by a translator called an assembler
  • 23.  Even assembly languages are difficult to work with.  High-level languages such as C provide a much more convenient notation for implementing algorithms.  They liberate programmers from having to think in very low-level terms, and help them to focus on the algorithm instead.  A program written in a high-level language is translated to assembly language by a translator called a compiler.  The assembly code produced by the compiler is then assembled to produce an executable program.
  • 24. A Simple C Program  #include <iostream.h>  int main (void)  {  printf("Hello Worldn“);  }
  • 25. Annotation for the simple c program  This line uses the preprocessor directive #include to include the contents of the header file iostream.h in the program. Iostream.h is a standard C++ header file and contains definitions for input and output.
  • 26. Cont…  This line defines a function called main.  A function may have zero or more parameters; these always appear after the function name, between a pair of brackets.  The word void appearing between the brackets indicates that main has no parameters.  A function may also have a return type; this always appears before the function name.  The return type for main is int (i.e., an integer number).  All C++ programs must have exactly one main function. Program execution always begins from main.
  • 27. Cont…  This brace marks the beginning of the body of main.  This line is a statement.  A statement is a computation step which may produce a value.  The end of a statement is always marked with a semicolon (;).  This statement causes the string "Hello Worldn" to be sent to the printf output stream.  A string is any sequence of characters enclosed in double-quotes.  The last character in this string (n) is a newline character which is similar to a carriage return on a type writer.
  • 28.  This brace marks the end of the body of main.
  • 29. Variable  A variable is a symbolic name for a memory location in which data can be stored and subsequently recalled.  Variables are used for holding data values so that they can be utilized in various computations in a program.  All variables have two important attributes:  A type which is established when the variable is defined (e.g., integer, real, character). Once defined, the type of a C variable cannot be changed.  A value which can be changed by assigning a new value to the variable. The kind of values a variable can assume depends on its type. For example, an integer variable can only take integer values (e.g., 2, 100, -12).