C Programing by Omar
C Programing by Omar
A series of coded software instructions to control the operation of a computer or other machine
Programing Language:
A programming language is a vocabulary and set of grammatical rules for instructing a computer
or computing device to perform specific tasks
Translator Program:
Compiler
Translator
A translator is a program that converts source code into object code
Assembler
Assembler:
Interpreter
Assembly
Assembler Machine Language
Language Program
Compiler:
Source Code Compiler Object Code
The language processor that reads the complete source program written in high-level language as a
whole in one go and translates it into an equivalent program in machine language is called a
Compiler.
Language Processing System
Source Code
Preprocessor
Compiler
Assembler
Linker
Binary Executable
Steps of Compiling
• 2nd Step
Object
Input Output
Code
Steps of Interpreting
Source
Code
Interpreter Output
Input
Difference Between Compiler &
Interpreter
Compiler Interpreter
Compiler scans the entire program and translates the Interpreter translates just one statement of the
whole of it into machine code at once program at a time into machine code
A compiler takes a lot of time to analyze the source An interpreter takes very less time to analyze the
code. However, the overall time taken to execute the source code. However, the overall time to execute the
process is much faster process is much slower
A compiler always generates an intermediary object An interpreter does not generate an intermediary
code. It will need further linking. Hence more memory code. Hence, an interpreter is highly efficient in terms
is needed of its memory
Keeps translating the program continuously till the A compiler generates the error message only after it
first error is confronted. If any error is spotted, it stops scans the complete program and hence debugging is
working and hence debugging becomes easy relatively harder while working with a compiler
Interpreters are used by programming languages like Compliers are used by programming languages like C
Ruby and Python for example and C++ for example
Algorithm:
A programming algorithm is a procedure or formula used for solving a problem
Advantages of Algorithm:
1. It is a step-wise representation of a solution to a given problem, which makes it easy to understand.
2. An algorithm uses a definite procedure.
3. It is not dependent on any programming language, so it is easy to understand for anyone even
without programming knowledge.
4. Every step in an algorithm has its own logical sequence so it is easy to debug.
5. By using algorithm, the problem is broken down into smaller pieces or steps hence, it is easier for
programmer to convert it into an actual program.
Disadvantages of Algorithm:
1. Algorithm is Time consuming.
2. Difficult to show Branching and Looping in Algorithms.
3. Big tasks are difficult to put in Algorithms.