Professional Documents
Culture Documents
To learn about the history of C language, let's first start with its root and early
developments. The root of all modern languages is ALGOL (Algorithmic Language).
ALGOL was the first computer programming language to use a block structure, and it
was introduced in 1960. In 1967, Martin Richards developed a language called
BCPL (Basic Combined Programming Language). BCPL was derived from
ALGOL. In 1970, Ken Thompson created a language using BCPL called B. Both
BCPL and B programming languages were typeless. After that, C was developed
using BCPL and B by Dennis Ritchie at the Bell lab in 1972. So, in terms of history
of C language, it was used in mainly academic environments, but at long last with the
release of many C compilers for commercial use and the increasing popularity of
UNIX, it began to gain extensive support among professionals.
1. Portability
In C, you can execute a block of code in different environments. Suppose, you create a
program in one platform and you are running or modifying the program in other
platforms. Portability is one of the best features of the C programming language.
2. Structured/Modular Programming language
In C, you can break the program into small blocks of code with the help of a function.
Instead of writing a long and complex code, you can divide the program into small
blocks of code as functions then you can perform multiple tasks such as finding the
area of square, rectangle, circle etc. Function is used for code reusability.
4. Speed
It compiles and executes faster than Java or Python. Because C is a compiler based
programming language and Java and Python are an interpreter based programming
language.
5. Popular
6. Rich Library
The C programming language has a rich library which offers useful built-in functions.
Apart from these functions, you can also add or define user-defined functions to the
library. These functions help in solving numerous types of problems easily and also
help in better and clean coding.
8. Case Sensitive
Pointer is one of the most useful features in C. With pointers, you can work with the
memory in C. You can also use pointers with arrays, structures, functions etc.
10. Recursion
Different programming languages have their own format of coding. The basic structure of
C program is shown below-
1. Documentation section : The documentation section consists of a set of
comment lines giving the name of the program, the author and other details,
which the programmer would like to use later.
Example : // To find average of three numbers single line comment
/* To find average
three numbers */ multiline comment
2. Link section : The link section provides instructions to the compiler to link
functions from the system library.
Example : #include<stdio.h>
4. Global declaration section : There are some variables that are used in more
than one function. Such variables are called global variables and are declared in
the global declaration section that is outside of all the functions. This section
also declares all the user-defined functions
5. main( ) function section : Every C program must have one main function
section. This section contains two parts; declaration part and executable part
Declaration part : The declaration part declares all the variables used in
the executable part.
C-Character Set
Every programming language has its own set of characters to form the lexical
elements. Characters are used in forming either words or numbers or even expressions
in C programming. Characters in C are classified into 4 groups:
1. Letters
• Lowercase Letters: a to z
2. Digits
3. Special Characters
comma , slash /
period . backslash
semicolon ; percentage %
colon : left and right brackets [ ]
question
left and right parenthesis ( )
mark ?
4. White Spaces
• Blank Spaces
• Tab
• Carriage Return
• New Line
C-Tokens
1. Identifiers
2. Keywords
3. Constants
4. Operators
5. Special Characters
6. Strings
Identifiers:
Keywords
Keywords are words whose meaning has already been defined by the computer – they
are pre-defined words in the C compiler. Each Keyword is meant to perform a specific
function in a C program. Keywords are case sensitive and are written in lower case.
The C language has 32 keywords, they are :
Constants : A constant is a fixed value that cannot be altered during the execution of
a program.