IP Unit 1
IP Unit 1
Flow Chart Symbol
Input/Output: A parallelogram denotes any function of
input/output type. Program instructions that take input from input
devices and display output on output devices are indicated with
parallelogram in a flowchart.
The compilation process can be divided into four steps, i.e., Pre-processing, Compiling,
Assembling, and Linking.
The preprocessor takes the source code as an input, and it removes all the comments
from the source code. The preprocessor takes the preprocessor directive and
interprets it. For example, if <stdio.h>, the directive is available in the program, then
the preprocessor interprets the directive and replace this directive with the content of
the 'stdio.h' file.
Continue………..
Preprocessor
A preprocessor, generally considered as a part of compiler, is a tool that produces
input for compilers. It deals with macro-processing, augmentation, file inclusion,
language extension, etc.
Interpreter/Compiler
An interpreter, like a compiler, translates high-level language into low-level machine
language. The difference lies in the way they read the source code or input. A
compiler reads the whole source code at once, In contrast, an interpreter reads a
statement from the input, converts it to an intermediate code, executes it, then takes
the next statement in sequence.
Assembler
An assembler translates assembly language programs into machine code.The output
of an assembler is called an object file, which contains a combination of machine
instructions as well as the data required to place these instructions in memory.
Continue……….
Linker
Linker is a computer program that links and merges various object
files together in order to make an executable file. All these files might
have been compiled by separate assemblers. The major task of a linker
is to search and locate referenced module/routines in a program and to
determine the memory location where these codes will be loaded,
making the program instruction to have absolute references.
Loader
Loader is a part of operating system and is responsible for loading
executable files into memory and execute them. It calculates the size
of a program (instructions and data) and creates memory space for it.
It initializes various registers to initiate execution.
Example(Hello Program)
#include <stdio.h>
int main()
{
printf("Hello javaTpoint");
return 0;
} In the above flow diagram, the following steps are taken to execute a
program:
• Firstly, the input file, i.e., hello.c, is passed to the preprocessor, and the
preprocessor converts the source code into expanded source code. The
extension of the expanded source code would be hello.i.
• The expanded source code is passed to the compiler, and the compiler
converts this expanded source code into assembly code. The extension of
the assembly code would be hello.s.
• This assembly code is then sent to the assembler, which converts the
assembly code into object code.hello.o
• After the creation of an object code, the linker creates the executable file.
The loader will then load the executable file for the execution.hello.exe
Introduction to Programming Language C
Introduction
The C Language is developed by Dennis Ritchie.
It can be defined by the following ways:
• Mother language
C programming is considered as the base for other programming languages, that is why
it is known as mother language.
• System programming language
A system programming language is used to create system software.
• Procedure-oriented programming language
A procedural language specifies a series of steps for the program to solve the problem .
A procedural language breaks the program into functions, data structures, etc
• Structured programming language
Structure means to break a program into parts or blocks so that it may be easy to
understand.
• Mid-level programming language
C is considered as a middle-level language because it supports the feature of both low-
level and high-level languages.
History of C Language
• C programming language was developed in 1972 by Dennis Ritchie at
bell laboratories of AT&T (American Telephone & Telegraph), located in
the U.S.A.
• Initially, C language was developed to be used in UNIX operating system.
It inherits many features of previous languages such as B and BCPL.
Features of C Language
C is the widely used language. It provides many features that are given below.
• Simple
• Machine Independent or Portable
• Mid-level programming language
• structured programming language
• Rich Library
• Memory Management
• Fast Speed
• Pointers
• Recursion
Language Year Developed By