The document discusses computer programming in C language. It begins by explaining that C was created in 1972 as a system programming language to give programmers access to a machine's instruction set. It describes the major components of a computer as hardware, software, and liveware (users). It then covers the different types of programming languages as low-level (machine and assembly), high-level, and their characteristics. The document also discusses system software types like operating systems and utilities, and how programs are compiled from source code to machine code.
2. Introduction to C Language
The C language was first developed in 1972
by Dennis M. Ritchie at Bell Telephone
Laboratories Inc. (now a part of AT & T) as a
system programming language.
Ritchie’s intent in designing C was to give
programmers a convenient means of
accessing a machine’s instruction set.
3. Operating system
The resources of a computer include the
CPU, main memory, devices such as printer
that are connected to the computer.
Operating system controls the entire
operations of the computer.
4. Components of Computer
Computer is composed of three
major components :
1) Hardware(which we can touch
upon)
2) Software(operations, instructions
etc)
3) Liveware (users/Human beings
who interact with H/W & S/W)
5. Program
There is a close analogy between learning English language
and learning C language.
C is a middle-level language
6. Programming Language types
Low level languages are machine level and assembly
level language.
In machine level language computer only understand
digital numbers i.e. in the form of 0 and 1.
It is difficult to implement instruction in binary code.
Not portable, difficult to maintain and also error prone.
Programming language concern these are of two types.
1) Low level language 2) High level language
7. Assembly Language
The assembly language is on other hand modified
version of machine level language.
It is easy to write and understand
The translator used here is assembler to translate into
machine level.
Data are stored in the computer register, which varies
for different computer. Hence it is not portable.
8. High Level Langauge
High level language:
It is English like language.
It is simple, ease to maintain, portable
It not understood by the machine.
So it need to translate by the translator into machine
level.
The language in this category is Pascal, Cobol, Fortran
etc.
9. Differentiation
High level language Low level language
It is like english language It is in binary code
It is programmer friendly It is machine friendly
It is simple to understand,
debug and maintain
It is complex to understand
debug and maintain
It runs on any platform It doesn't run on any platform
Pascal, C++ Assembly language
11. Types of system software
System software can be classified into following types
1) Operating system
2) Translators
3) Loaders/Linker
4) System Utilities
13. Compiler
Compiler and interpreter are
used to convert the high level
language into machine level
language.
The program written in high
level language is known as
source program and the
corresponding machine level
language program is called as
object program.
When program size is large
then compiler is preferred.
In Window:turbo C++,
14. Differentiation
Interpreter Compiler
1)Translate program one statement
at a time
1) Translate entire program at a time
2) It generate error message
When first error encounter, hence
debugging is easy
2) It generate error message when
entire source code is scan, hence
debugging is complex
3)It takes less amount of time to
analyze the source code but overall
execution time is slow
3) It takes large amount of time to
analyze the source code but overall
execution time is faster
4) No intermediate object code is
generated, hence memory efficient
4) Generate intermediate object
code which further require linking,
hence required more memory
5) Programming languages like
Python, Ruby use interpreter
5) Programming languages like C,
C++ use compiler
15. Assembler
Assembler:
Programs written in assembly language require a special
program, called an assembler, to translate assembly
language instructions into machine instructions.
Programs are written in assembly language only when
execution speed is a high priority.