CH 1
CH 1
In
The
World
Of
‘C’
TEXT BOOK:
Programming in ANCI ‘C
By: E Balagurusamy. TMH
Reference Books:
Marks system:
Theory External Exam 60
Practical Exam / Viva 50
Internal (Avg. of 3 exams) 36
Attendance 4
Importance of Subject
‘C is the base language of any
other programming language.
arguments
Link Section
Definition Section
Global Declaration Section
main() function section
{
Declaration part
Executable part
}
Subprogram section
Function1
Function2 … user defined function
There are two ways to run programs written in a high-
level language.
The most common is to compile the program
The other method is to pass the program through an
interpreter.
Compiler
Why compiler is require ?
As machine (a processor) can operate
On binary code instruction only…..
If we use higher level language then …
For execution of the program we must
Convert it to lower level / machine level
Code.
Means,
A program that translates source code into
object code.
The compiler derives its name from the way it
works, looking at the entire piece of source
code and collecting and reorganizing the
instructions.
Interpreter:
which analyzes and executes each line of
source code without looking at the entire
program.
Advantage of interpreter:
It can execute a program immediately.
Compilers require some time before an
executable program emerges.
But,
However, programs produced by compilers run
much faster than the same programs executed
by an interpreter.
C Compiler
Input Output
No1. &
No2. PROGRAM No1 + No2
Algorithm
Specifies steps of doing the things
Irrespective of any programming language
Example: Addition of two numbers
Input/Output Rectangle
Decision Box
Connector
Flowchart-example
Example: To add two numbers and display the
result.
Start
End
Files:- storage of logically related data