0% found this document useful (0 votes)
10 views9 pages

C Programing by Omar

The document explains the concepts of programming, programming languages, and the roles of compilers and interpreters in translating source code into machine code. It outlines the advantages and disadvantages of assemblers, compilers, and interpreters, as well as the rules, advantages, and disadvantages of algorithms. Additionally, it provides examples of compiled and interpreted languages.

Uploaded by

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

C Programing by Omar

The document explains the concepts of programming, programming languages, and the roles of compilers and interpreters in translating source code into machine code. It outlines the advantages and disadvantages of assemblers, compilers, and interpreters, as well as the rules, advantages, and disadvantages of algorithms. Additionally, it provides examples of compiled and interpreted languages.

Uploaded by

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

Program:

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

An assembler is a translator used to translate assembly language into machine language


Advantages of Assembler
• It allows complex jobs to run in a simpler way.
• It is memory efficient, as it requires less memory.
• It is faster in speed, as its execution time is less.
• It is mainly hardware-oriented.
• It requires less instruction to get the result.
• It is used for critical jobs.
• It is not required to keep track of memory locations.
• It is a low-level embedded system.
Disadvantages of Assembler
1. It takes a lot of time and effort to write the code for the same.
2. It is very complex and difficult to understand.
3. The syntax is difficult to remember.
4. It has a lack of portability of program between different
computer architectures.
5. It needs more size or memory of the computer to run the long
programs written in Assembly Language.
Which languages are compiled?
C, C++, Objective-C, C#, Pascal, COBOL, ADA, Visual Basic, Smalltalk, Scheme etc.

Which languages are interpreted?


BASIC, php, Python, Perl, Ruby, JavaScript etc.

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

• 1st Step List of


Source Errors
Compiler
Code Object
Code

• 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

Rules of Writing Algorithm:


•Input and output should be defined precisely.
•Each step in the algorithm should be clear and unambiguous.
•Algorithms should be most effective among many different ways to solve a problem.
•An algorithm shouldn’t include computer code.

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.

You might also like