Wednesday 28 August 2013

Development of “C” (Introduction and history) | C Programming Language Tutorial pdf



Development of “C” (Introduction and history)

“C” is a programming language developed at AT & T Bell Laboratories of USA in 1972. It was developed Dennis Ritche in late 1970?s. it began to replace the more familiar languages of that time like PL/1, ALGOL etc.
1. “C” became popular because of its reliability, simple and easy to use
2. It was friendly capable and reliable
3. ALGOL 60 was developed and did not become popular because it was too general and too abstract.
4. They developed “CPU” (Combined Programming Language)
5. Next as it could not come up to make ALGOL 60 better one they moved to “BCPL” (Basic Combines Programming Language. Developed by martin Richard Cambridge university)
6. At the same time a language called “B” written by ken Thompson at AT & T'S.
Bell laboaratories as a further simplification of BCPL.
7. “C” s compactness and coherence is mainly due to it?s one man language. Ex- LISP, AASCA

Year    Lang        Developed by                    Remarks
1960    ALGOL  International Committe   too general, too abstract
1963    CPL       camebridge university    Hard to Learn & implementation
1967    BCPL    Camebridge university    could deal only special problem
1970     B          AT&T                          could deal only special problem
1972     C          AT & T                        Lost Generality of BCPL, B restored

Note : C is a middle level language because it was due to have both a relatively good programming efficiency and relativity good machine effecience.

Features of “C” Language :
1. It is robust language because of rich set of binary in – function
2. It is efficient and fast because of its variant data-types and powerful operation.
3. It is highly Portable i.e., programs written in one computer can be run on another
4. It is well suited for structure program, thus allows the user to think about the problem in the terms of functional blocks.
5. Debugging, testing and maintenance is easy
6. ability to extend itself, we can continuously add our own functions to the program.

Complier : This reads the entire source program and converts it to the object code. It provides error not of one line, but errors of the entire program. It executes as a whole and it is fast.
Interpreter : It reads only one line of a source program at a time and converts it into an object code. In case of errors/same will be indicated instantly. It executes line by line and it is slow.
Linker is a function which links up the files that an present in the operating system, it also links the files for the hardware and makes the system ready for executing.
Preprocessor : This is a program, that processes the source program before it is passed on to the compiler. The program typed in the editor is the source code to the preprocessor, then it passed the source code to the compiler. It is not necessary to write program with preprocessor & activity
Preprocessor directories are always initialized at the beginning of the program. it begins with the symbol (#) hash. It place before the main() function
Eg: # include <station>
# define PI 3.14

Character Set : The characters that can be used to form words and expressions depends upon the computer to which the program is run

The Characters in C are:
1. Letters A-X, a-z, both upper and lower
2. Digits 0-9
3. Special character, +,-,*,”,;,./,
4. which spaces newline, horizontal tab;,carriage return ,blank space

“C” Tokens:
Individual words and punctuation marks are characters. In a “C” program the smallest individual units are known as “C” tokens. It has 6types of token's

Keywords : 
Keywords are reserved words by compiler. Keywords are assigned with fixed meaning and they cannot be used as variable name. No header file is needed to include the keywords.
There are 32 keywords
Eg : auto, break, double, int, float

Identifiers :
These are the names of variables ,functions and arrays, these are the user defined names
Eg : # define NUM 10
# define A 20
“NUM”, “A” are user – defined id

Constants : constants in “C” are applicable to the values which not change during the execution of a program.

Integer Constants : Sequence of numberr 0-9 without decimal points, fractional part or any other symbols. It requires two or four bytes, can be +ve, -ve or Zero the number without a sign is as positive.
Eg: -10, +20, 40

Real Constants : Real constants are often known as floating constants.
Eg: 2.5, 5.521, 3.14 etc.

Character Constants:
1. Single character const : A single character constants are given within a pair of single quote mark.
Eg : 'a', '8', etc.

String Constant : These are the sequence of character within double quote marks
Eg : “Straight” “India”, “4”

Variables : This is a data name used for storing a data, its value may be changed during the execution. The variables value keep?s changing during the execution of the program
Eg : height, average, sum, etc.

Data types: C language is rich in data types
ANSI – American National Standard Institute

ANSI C Supports Three classes of data types:
1. Primary data type(fundamental)
2. Derived data types
3. User defined data types
All “C” compiler supports 5 fundamental data types:
1. Integer (int)
2. Character (char)
3. floating point (float)
4. double-precession (double)
5. void

0 comments:

Post a Comment

 

C Programming Language Interview Questions and Answers Tutorial for beginners. Copyright 2013 All Rights Reserved