Flow Chart
Flow Chart
OBJECTIVES
1.0. Programming Methodology and Introduction to C Language
1.1. State different steps involved in problem solving
1.2. Define algorithm and know its characteristics
1.3. State the steps involved in algorithm development
1.4. Develop algorithms for simple problems.
1.5. Define flowchart and know symbols used in drawing flowcharts
1.6. Draw flowchart for simple problems.
1.7. Differentiate algorithm and flowchart
1.8. Define program and differentiate between program and algorithm
1.9. Define High level language and low level language
1.10. Define Compiler, Assembler, Linker and Loader
1.11. Define source code, assembly code, object code, machine code.
1.12. state the importance of C language
1.13. Explain the structure of C program
1.14. List and Explain different stages in converting the C program source
code to executable code.
1.15. Explain the steps involved in executing the C program
Programming Methodology and Introduction to C Language 1-2
5. Pseudocode
o A pseudocode is neither an algorithm nor a program.
o It is an abstract form of a program. It consists of English like statements, which
perform the specific operations.
o It is defined for an algorithm.
o It does not use anigraphical representation.
o In a pseudocode, the program is represented in terms of words and phrases,
but the syntax of a program is not strictly followed.
o Advantages
Easy to read
Easy to understand
Easy to modify
The program can be developed easily from a pseudo code rather than a
flowchart.
Example 1: Write a pseudocode to perform the basic arithmetic operations.
Solution:
Read n1, n2
Sum = n1 + n2
Diff = n1 - n2
Mult = n1 * n2
Quot = n1/n2
Print sum, diff, mult, quot
End
6. Coding
o The complete structure of a problem to be solved by a computer is called a
program.
o The computer does not process an algorithm or a flowchart, but executes the
program.
o A program is a set of instructions to solve a particular problem by the
computer and the actual process of writing a program is called coding.
o Programs are written using programming languages and are fed to the
computer.
Rectangle Processing
Arrows Connections
Circle Continuation
Example 2: Draw a flowchart to find the area of a triangle when its three
sides are given.
Example:
The assembly language program (ALP) that is given as input to the assembler is
called source program and the output of the assembler is called object program.
There are different assembler programs available in the software market.
Example: TASM (Turbo Assembler), MASM (Macro Assembler).
1.10.2. Compiler
The process of translating high level language program into machine language
requires an intermediatory program called the translator.
The compiler and interpreter are two translator programs that are used to translate
the high level language programs into machine language.
Here, also the program written in high level language is called source program.
The corresponding program after translation (either by compiler or interpreter) is
called object program.
The high level language program to machine level conversion is shown in figure.
a) Linker vs Loader
Linker is the software that links the object The loader is the system software that
code with additional files such as header loads the executable file generated by the
files and creates an executable file with linker to the main memory.
.exe extension.
Linker Helps to link a object modules of program into a single object file.
It is executable file as output for loader.
* Programming Language *
Part-I
Documentation section
Link (preprocessor)section
Definition section
Global Declaration section
OR Part-II
main() Function section
{
Declaration part;
Executable part;
}
Part-III
User defined functions
4. Global Declarations
There are some variables that are used in more than one function. Such variables
are called global variables whose existence is known throughout the program. This
declaration should be made before main() function.
Examples:
1. inta,b,c;
2. float x,y,z;
3. char name[20];