You are on page 1of 8

History of C Programming Language:

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.

BCPL 1967 Martin Richards


B 1970 Ken Thompson
Traditional C 1972 Dennis Ritchie
K&R C 1978 Kernighan and Ritchie
ANSI C 1989 ANSI Committee
ANSI/ISO C 1990 ISO Committee

Features of C Programming Language

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.

3. Simple and Efficient

The C programming language is easy to implement. The syntax of the C programming


language is easy to understand. It is efficient and simple to learn and use.

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

The C programming language is used in making operating systems and embedded


systems. It is one of the most widely used programming languages in the world.

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

C programming language is case sensitive. If we declare two variables such as “X”


and “x” as an integer then the C language treats these two variables differently.
9. Pointer

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

In C, you can define a function inside of a function. This technique is called


Recursion. This will help you in code reusability.

Basic Structure of a C Program

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>

3. Definition section : The definition section defines all symbolic constants.


Example #define PI 3.142

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.

Executable part : There is at least one statement in the executable part.


These two parts must appear between the opening and closing braces.
The program execution begins at the opening brace and ends at the
closing brace. The closing brace of the main function is the logical end
of the program. All statements in the declaration and executable part end
with a semicolon.
6. Subprogram section : The subprogram section contains all the user-defined
functions that are called in the main () function. User-defined functions are
generally placed immediately after the main () function, although they may
appear in any order.

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

In C programming, we can use both uppercase and lowercase letters of English


language
• Uppercase Letters: A to Z

• Lowercase Letters: a to z

2. Digits

We can use decimal digits from 0 to 9.

3. Special Characters

C Programming allows programmer to use following special characters:

comma , slash /

period . backslash

semicolon ; percentage %
colon : left and right brackets [ ]

question
left and right parenthesis ( )
mark ?

4. White Spaces

In C Programming, white spaces contain:

• Blank Spaces
• Tab
• Carriage Return
• New Line
C-Tokens

The individual elements of a program are called Tokens. In a C program, a number of


individual units or elements occur. These elements are called C Tokens. In the C
language, the following 6 types of tokens are available:

1. Identifiers

2. Keywords

3. Constants

4. Operators

5. Special Characters

6. Strings

Identifiers:

Each program element in a C program is called an identifier. An identifier is a


variable that holds a value and stores it in the memory.

Rules for declaring identifiers:

1. The first character must be an alphabet(uppercase or lowercase) or an


underscore

2. All succeeding characters must be either letters or digits.

3. Uppercase and lowercase identifiers are different in C

4. No special characters are allowed except the underscore “_”

5. Keywords should not be used as 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.

Operators: Operators are symbols that provide instructions for the


performance of various mathematical and logical operations.

Special characters : All the characters other than a to z, A to Z, and 0 to 9


are special characters. Example: {,},[,],(,)

String : A string is a group of characters that should be enclosed in double


quotations. For example: char string[]=“gitam”, “BCA College”

You might also like