Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Programming

Structures
•A flowchart is a diagrammatic
representation that illustrates the sequence
of operations to be performed to get the
solution of a problem.

• Flowcharts are generally drawn in the


early stages of formulating computer
solutions.

Basic Flowchart Symbols


Terminal Symbol
Used to denote the start or end of the
flowchart.

Basic Flowchart Symbols


Initialization box
Initializes the variables and constant data
that will be used throughout the flowchart.

Basic Flowchart Symbols


Input box
Used to read inputs.

Basic Flowchart Symbols


Process box
Represents the part of the flowchart
where process is to take place.

Basic Flowchart Symbols


Output box
Used to display outputs.

Basic Flowchart Symbols


Decision box
Used to represent a branch in the
flowchart.

Basic Flowchart Symbols


On-page connector
Symbol that connects parts of the
flowchart in the same page.

Basic Flowchart Symbols


Off-page connector
Symbol that connects parts of the
flowchart in different pages.

Basic Flowchart Symbols


• Create a flowchart that accepts two
numbers, adds them and displays the sum.
• Create a flowchart that will determine if
the average of two numbers is passed or
failed. If average is less than 75 is passed
otherwise is failed.
• Create a flowchart that will print the first n
numbers.

Sample Problems
Basic Programming Structures:
• Sequential
• Conditional
• Repetitive/Iteration/Looping

Structure of C Program
Runtime Errors are those errors that occur
during the execution of a c program and
generally occur due to some illegal
operation performed in the program.

• Dividing a number by zero


• Trying to open a file which is not created
• Lack of free memory space

Types of Error in C
Compile errors are those errors that
occur at the time of compilation of the
program. C compile errors may be
further classified as:

• Syntax Error
• Semantic Error

Types of Error in C
Logical errors are the errors in the
output of the program.

The presence of logical errors leads to


undesired or incorrect output and are
caused due to error in the logic applied
in the program to produce the desired
output.
Types of Error in C

You might also like