History of C
Year Language Developed by Remarks
1960 ALGOL-Algorithmic Language International Committe Too general, too abstract
1963 CPL-Combined Programming Cambridge University Hard to learn, difficult to
Language implement
1967 BCPL-Basic CPL-Combined Martin Richards at Cambridge Could deal with only specific
Programming Language University problems
1970 B Ken Thompson at AT & T Could deal with only specific
problems
1972 C Dennis Ritchie at AT & T Lost generality of BCPL and B
restored.
ALGOL
• The root of all modern languages is ALGOL
Introduced in the early 1960s.
• ALGOL was the first computer language to use a
block structure.
• ALGOL gave (introduced) the concept of
structured programming to the computer science.
• Structured programming: Sequence, Decision,
Repetition
Peter Naur
CPL
• CPL-Common Programming Language
• CPL was influenced by ALGOL 60 and aimed to
extend its capabilities to broader application
areas, including industrial process control and
business data processing.
• CPL introduced several advanced features for its
time, such as structured programming and
functional paradigms. Christopher Strachey
Max(Items, ValueFunction) = value of
• However, its complexity and slow § (Best, BestVal) = (NIL, -∞)
implementation hindered its adoption. The first while Items do §
(Item, Val) = (Head(Items),
CPL compiler was likely completed around 1970, ValueFunction(Head(Items)))
but the language never gained significant if Val > BestVal then (Best, BestVal) :=
(Item, Val)
popularity and faded by the 1970s. Items := Rest(Items) ̸§
result is Best ̸§
BCPL- Basic Combined Programming language
• BCPL is a structured, imperative and procedural programming
language.
• BCPL was designed to be a simple and efficient language
suitable for systems programming, especially on limited
hardware – Designing and developing system software.
• The way BCPL was designed made it possible to develop
compact and simple compilers, some of which apparently
executed in as little as 16 kilobytes.
• Also, the original compiler, which was developed using BCPL, Martin Richards
was quite portable. As a result, BCPL was used to bootstrap a
number of systems.
• The portability of the compiler was significantly influenced by its
structure.
• Richards created BCPL by - removing those full language
features that pose a challenge for compilation.
B
• The B Programming Language is developed by Ken
Thompson and Dennis Ritchie at Bell Labs in around
1967-69.
• B programming language is a language based on BCPL.
Easier to understand and write.
• It was derived from the BCPL, and the name of the ‘B’
language is possibly from the BCPL contraction. Ken Thompson
• B language was designed to develop non-numeric,
recursive and machine-independent applications such as
software language.
• However, B had limitations, including a lack of structured
programming constructs, such as loops and if-else
statements. This led to the development of the C
programming language
C Programming Language
• Dennis MacAlistair Ritchie, born on September 9, 1941, in
Bronxville, New York, is widely recognized as the father of
the C programming language.
• Ritchie created the C programming language in the early
1970s. The language was developed as an extension of
the B programming language, which was created by his
colleague Ken Thompson. Dennis Ritchie
• The need for a more powerful and flexible language led
Ritchie to develop C, which quickly became popular due
to its efficiency and portability.
• Typeless - Typeform
C
• C is a general-purpose, mid-level programming language.
• It is widely used for system programming, embedded systems, and
applications requiring high performance.
• C is highly portable i.e., software written for one computer can be run
on another computer.
• An important feature of ‘C’ is its ability to extend itself.
• A C program is basically a collection of functions.
• C supports functions that enables easy maintainability of code, by
breaking large file into smaller modules.
• Comments in C provides easy readability
Features of C
What you will study?
• Programming methodology, overview of C, Lexical elements, syntax
rules, basic data types, operators, expressions, flow of control,
function definitions, conditional execution, loops.
• One dimensional array, two dimensional arrays, sparse matrix,
recursion, pointers, strings, preprocessor, file input/ output.
• Data Structures: ADTs, linear data structures, linked list, stacks and
queues, applications.
Topics to be Covered
• INTRODUCTION
• CONSTANTS & VARIABLES
• OPERATORS & EXPRESSIONS
• STRUCTURE OF A C PROGRAM
• CONTROL STRUCTURES
• ARRAYS AND STRINGS
• FUNCTIONS
• STORAGE CLASSES
• STRUCTURES & UNIONS
• POINTERS
• DYNAMIC MEMORY ALLOCATION
• FILE MANAGEMENT IN C
• COMMAND LINE ARGUMENTS
Structure of C Program – Preliminary Requirements
C Tokens:
• A token is an atomic unit (smallest indivisible units) in a
program.
• The most basic elements in a C program recognised by the
compiler are a single character or a group of characters
called C tokens.
• When you write a C program, the compiler first breaks
your code into tokens before analyzing it. The compiler
cannot breakdown the token any further.
• Example: the words ‘main’, ‘{‘(brace), ‘(’ (parenthesis) are
all tokens of C program.
Types of Tokens in C - 6 main types of tokens
1. Keywords: Reserved words with special meaning. Eg: int,
return, if, while, for.
2. Identifiers: Names given to variables, functions, arrays, etc.
Eg, age, main, sum.
3. Constants: Fixed values that do not change. Eg: 10, 'A',
3.14.
4. String literals: Sequence of characters enclosed in double
quotes. Eg: "Hello World".
5. Operators: Symbols that perform operations. Eg: +, -, *, /, ==,
&&.
6. Special symbols / Punctuators: Symbols used for
structure. Eg: ;, {}, (), [], ,.
Example of Token in a C-Program:
int main() { Breaking into Tokens:
int a = 10; •int → keyword •10 → constant
•main → identifier •; → special symbol
•printf → identifier
printf("Hello"); •(, ) → spespecialcial
symbols •"Hello" → string
return 0; •{, } → symbols
literal
•return → keyword
} •int → keyword •0 → constant
•a → identifier
•= → operator
Let’s get started: