0% found this document useful (0 votes)
37 views4 pages

Lesson 1-3

The document discusses algorithms and flowcharts, defining algorithms as step-by-step procedures to solve problems and flowcharts as diagrams that depict the flow of a program. It also covers different types of flowchart structures like sequence, decision, repetition, and case structures. Basic flowcharting symbols and their uses are explained as well as an introduction to the C programming language, its history, features, and common uses.

Uploaded by

mark lawrence
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views4 pages

Lesson 1-3

The document discusses algorithms and flowcharts, defining algorithms as step-by-step procedures to solve problems and flowcharts as diagrams that depict the flow of a program. It also covers different types of flowchart structures like sequence, decision, repetition, and case structures. Basic flowcharting symbols and their uses are explained as well as an introduction to the C programming language, its history, features, and common uses.

Uploaded by

mark lawrence
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

FOPR

Algorithms
– referred to any computation performed via a
set of rules applied to numbers written in
decimal form.
– Step by step procedure to solve a given
problem
– Word “Algorithm” was derives from the
phonetic pronunciation of the last name of
Abu Jafar Mohammed inb musa al-
Khowarizmi
– It is a finite sequence of well-defined General Rules for Flowcharting
instructions, each of which can be
1. All boxes of the flowchart are connected
mechanically carried out in a finite amount of
with Arrows (not lines)
time
2. Flowchart symbols have an entry point on
the top of the symbol with no other entry
points. The exit point for all flowchart
symbol is on the bottom except for the
Decision symbol.
3. The Decision symbol has two exit points;
these can be on the sides or the bottom and
one side
4. Generally, a flowchart will flow from top to
Steps in making a good algorithm bottom. However, an upward flow can be
shown as long as it does not exceed 3
1. Inputs and outputs should be defined symbols
precisely 5. Connectors are used to connect breaks in the
2. Each steps in algorithm should be clear and flowchart.
unambiguous 6. Subroutines and interrupt programs have
3. Algorithm should be most effective among their own and independent flowcharts
many different ways to solve a problem 7. All flow charts start with a terminal or
4. An algorithm shouldn’t have computer code. predefined process (for interrupt programs
Instead, the algorithm should be written in or subroutines symbol.
such a way that it can be used in similar 8. All flowcharts end with a terminal.
programming languages.
What is a flowchart?
Pseudocode
- A flowchart is a diagram that depicts the
- Is an artificial and informal language that “FLOW” of the program.
helps develop algorithms
- It is useful in developing algorithms what
will be later converted into c language
programming
- It is similar to English statements and not
executed on computers
Flowcharts
- A tool developed in the computer industry,
for showing the steps involved in a process.
- A flowchart is a diagram made up of boxed,
diamonds and other shapes, connected by
arrows – each chape represents a step in the
process, and the arrows show the order in
which they occur.
Basic Flowcharting symbol
Terminal Modules
- Represented by rounded rectangles indicate a - The position of the module symbol indicates
starting or ending point the point the module is executed
- A separate flowchart can be constructed for
the module

Input and output operations


- Represented by parallelograms indicate and
input or output operation.

Four Flowchart Structures


1. Sequence
2. Decision
Processes 3. Repetition
4. Case
- Represented by rectangle indicates a process
such as a mathematical computation or Sequence Structure
variable assignment
- A series of actions are performed in a
sequence
- The pay- calculating example was sequence
flowchart

Connectors
- Jumps to other portions of the flowchart

Decision Structure
- The flowchart segment below structures how
a decision structure is expressed in C as an
if/else statement
INTRODUCTION TO C
C Language History
- The C programming language is a structure-
oriental programming language, developed
at Bell Laboratories in 1972 by Dennis
Ritchie
- C programming language features were
derived from an earlier language called “B”
(Basic Combined Programming Language –
BCPL)
- C language was invented for implementing
Repetition Structure UNIX operating system
- The flowchart segment below shows a - In 1978, Dennis Ritchie and Brian
repetition structure expressed in C as a while Kernighan published the first edition “ The
loop C Programming Language” and commonly
known as K&R C
- The ANSI standard, or “ANSI C”, was
completed late 1988

Features of c language and uses of C


language
Features:
1. Reliability
2. Portability
3. Flexibility
4. Interactivity
5. Modularity
6. Efficiency and effectiveness
Case Structure Uses:
- It is used for multi way selection of items 1. Database systems
2. Graphics packages
3. Word processors
4. Spreadsheets
5. Operating system development
6. L compilers and assemblers
7. Network drivers
8. Interpreters
Levels of Programming languages
Low Level
- Low level languages provide nothing other
than access to the machines basic instruction
set. Example: Assemble
Middle Level
- Middle level languages do not provide all
the built-in functions found in high level
languages, but to provide all building blocks
needed to produce the result desired.
Examples: C, C++
High Level
- High level languages provide almost
everything that the programmer might need
too do as already built into the language. • printf() command is used to print the output
Example: Java, Python on the screen
• Each C programming statement is ended
Types of Languages
with semicolon ( ; ) which are referred as
1. Structure oriented language: statement terminator
- In this type of language, large programs are • C programs are compiled using C compilers
divided into small programs called functions and displays output when executed.
- Prime focus is on functions and procedures
that operate on the data
- Program structure follow “Top-Down
Approach”
- Examples: C, Pascal, ALGOL and Modula 2
2. Object oriented language
- In this type of language, programs are
divided into objects
- Prime focus is in the data that is being
operated and now on the functions or
procedures
- Program structure follows “Bottom-Up
Approach”
- Examples: C++, JAVA and C#
Basic Input and Output in C

Preprocessor Directives
#include preprocessor – It is used to include
header flies to a C program
#define – It is used to define a fragment of code that
is given with a name
Basic List of Header Files
stdio.h – input and output functions
conio.h – console input and output functions
ctype.h – character handling functions
math.h – mathematics functions
string.h – string functions
time.h – date and time functions
Key Points to Remember in C Programming
Basics
• C Programming is a case sensitive
programming languge

You might also like