C Programming
History of C Programming
Features of C Programming
More about C Programming
Advantages of C Programming
Disadvantages of C Programming
Write using C programming
2. ❖ C Programming
❖ History of C Programming
❖ Features of C Programming
❖ More about C Programming
❖ Advantages of C Programming
❖ Disadvantages of C Programming
❖ Write using C programming
Learning Objectives :-
3. C Programming :-
❖ C is a general-purpose programming language with features economy of expression,
modern flow control and data structures, and a rich set of operators .
❖ C is not a “very high level” language, nor a “big” one, and is not specialized to any
particular area of application. But its absence of restrictions and its generality make it
more convenient and effective for many tasks than supposedly more powerful
languages .
❖ C is also called as System Programming Lang. because it is useful for writing compiler
and operating systems .
❖ C has proven to be a pleasant, expressive, and versatile lang for a wide variety of
programs. It is easy to learn, and it wears well as one’s experience with it grows.
4. History of C Programming(1) :-
In 1965 :-
General Electric
AT & T Bell lab
MIT
Maltics
Multiplexed Information and Computing Service
Develop
time sharing
operating system
5. Explanation(1) :-
❖ In 1965, At&t bell lab joined an effort with the general electric company and project
MAC of the massachusetts Institute of technology to develop a new time sharing
operating system called as multics .
❖ The goal of multics system is to provide simultaneous computer access to a large
community of user, to supply ample computation power and data storage, and allow
user to share their data easily .
❖ Multics introduced many innovations, but had many problems.
❖ Bell Labs, frustrated by the size and complexity of Multics but not the aims, slowly pulled
out of the project.
6. History of C Programming(2) :-
AT & T Bell lab
Ken Thompson
Who want to develop
an operating system
UNICS
In 1969 :-
1) BCPL
2) B lang
3) Assembly
Options of Lang for write an O.S
1. B lang
2. Assembly
He Choose
Write an
OS called
Unics
Drawback of BCPL,B and Assembly Lang :-
● Machine level lang and not easy to understand .
● Since it is machine dependent, the programmer also needs to understand
the hardware.
● Difficult to remember the syntax.
● So modification in Code is also not easy task .
7. Explanation(2) :-
❖ In 1969 , After Bell pulled out , There are 2-3 Programmer in bell lab they want continue
that project but bell lab is not supported .
❖ There is one programmer in bell lab Ken thompson , He decide to continue working on
that project and he start working and using B and Assembly lang develop an new
operating system called as unics .
❖ There are some drawback like,
➢ UNICS is develop in machine level lang and not easy to understand .
➢ Since it is machine dependent, the programmer also needs to understand the hardware.
➢ Difficult to remember the syntax.
➢ So modification in source code is also not easy task .
8. History of C Programming(3) :-
Ken Thompson
Decided to rewrite
that os code in new
lang.
In 1972 :-
No Options
Options of Lang for write an O.S
Dennis
Ritchie
he called his friend
Dennis Ritchie
decided to write
new programming
lang
C Programming Lang.
Develop
Unix OS
9. Explanation(3) :-
❖ In 1972, Ken thompson is decide to rewrite UNICS operating system . So source code can
easily understand to developers .
❖ There is no high level programming lang is available so user can easily understand .
❖ Then ken thompson met Dennis Ritchie and after that dennis ritchie decide to write a
new programming lang to rewrite UNICS operating system .
❖ He develop a new programming lang is called as C Programming
❖ After that whole UNICS operating system is rewrite into C programming lang .
❖ Brian Kernighan is rename UNICS operating system name to UNIX .
10. Features of C Programming :-
C Programming
Portable Mid-level
Structured
Rich Library
Fast Executions
Simple
Modularity
Case sensitive
Recursion
Pointers PowerfulExtensible
Derived
Data type
Procedural
11. More About C Programming :-
❖ C provides a variety of data types .
❖ Fundamental types are characters, integers and floating-point.
❖ There are also derived data types created with pointers, arrays, structures and unions.
❖ Expressions are formed from operators and operands; any expressions, including an
assignment or a function call, can be a statement.
❖ Pointer provides for machine-independent address arithmetic.
❖ C provides the fundamental control flow constructions required for well-structure programs.
➢ Statement grouping
➢ Decision making(if-else)
➢ Selecting one of a set of possible cases(switch)
➢ Looping with the termination test at the top(while,for)
➢ Or at the bottom(do)
➢ Early loop exit(break)
12. More About C Programming :-
❖ Functions may return values of basic types, structure, union or pointers .
❖ Any Function may be called recursively.
❖ Function definitions may not be nested but variables may be declared in a block-structured
fashion.
❖ Functions of C program may exist in separate source files that are compiled separately.
❖ Variables may be internal to a functions, external but konows only within single source file, or
visible to entire program.
❖ A preprocessing step performs macro substitution on program text, inclusion of other source
files, and conditional compilation.
❖ C is relatively “low level” Language .
❖ C deals with the same sort of object that most computer do, namely characters, numbers and
addresses.
❖ C provides no operations to deal directly with composite object such as character strings, sets,
lists or arrays .
13. More About C Programming :-
❖ The language does not define any storage allocation facility other than static definition and
stack discipline provided by the local variables of functions.
❖ There is no heap or garbage collection.
❖ C itself provides no input/output facilities: there are no READ or WRITE statements and no
built-in file access methods.
❖ All of these higher-level mechanisms must be provided by explicitly called functions.
❖ Most C implementations have included a reasonably standard collection of such functions.
❖ C offers only straightforward,single-thread control flow: tests, loops, grouping and
subprograms, but not multiprogramming, parallel operations, synchronization or coroutines.
❖ In 1983, the American National Standards Institute(ANSI) established a committee to provide
a modern,comprehensive definition of C.
❖ “ANSI C” was completed in 1988 .
14. More About C Programming :-
❖ Changes In C by ANSI :-
➢ Declaring and defining functions.
➢ Structure assignment and enumerations.
➢ Floating-point computations may now be done in single precision.
➢ Unsigned types are clarified.
➢ Definition of a library to accompany C (it specifies functions for accessing the operating
system, formatted I/O, memory allocation, String manipulation).
➢ A collection of standard headers provides uniform access to declarations of functions
and data types.
➢ Program that use this library to interact with a host system are assured of compatible
behavior.
➢ The standard library functions are only called explicitly.
➢ Compilers will warn of most types errors and is no automatic conversion of incompatible
data types.
15. Advantages of C Programming :-
❖ C programming language is the structured programming language , So , It helps you to think of
the problem in terms of function modules or blocks , Collection of these modules makes a
complete program , This modular structure makes the program debugging , testing and
maintenance easier .
❖ C programming language is a building block for many other currently known languages ,
Python is a fully Object-Oriented High-Level programming language , It is written in C .
❖ C programming language is a small language , The concepts that it requires is quite short ,
There are 32 keywords in ANSI C only and its strength lies in its built-in functions , Many
standard functions are available that can be used for developing the programs .
❖ C language has the ability to extend itself , It is the collection of functions which are supported
by the C library this makes us easier to add our own functions to C library, Because of the
availability of large number of functions , the programming task becomes simple .
16. Advantages of C Programming :-
❖ C language is the compiled language versus an interpreted language , Explained simply , So ,
The code is compacted into executable instruction rather than being translated on the fly at
run time , This feature lends heavily to the speed of C programs and a lot of libraries are
written in C .
❖ C Language is very much popular language around the world and best suitable for the
programmer to learn at the first stage of the programming , There is not much vocabulary to
learn , C language has easy syntax and it is easier to learn , It is still a practical and compact
language and it comprises a good semantic .
❖ C programming language is easy to Learn ( Syntax is near to English Language ) , C language
syntax is very easy to understand , It uses keywords that we are using in our day to day life to
convey meaning or to get some decisions .
❖ C Language is very near to assembly programming , the hard use of pointers for example is a
very powerful mechanism , It has features that allow the programmer to organize the
programs in a clear, easy, logical way .
17. Advantages of C Programming :-
❖ C language allows meaningful names for variables without any loss of efficiency , So , C language
gives a complete freedom of programming style , including flexible ways of making the decisions
and a set of flexible commands for performing tasks repetitively ( for , while , do ) .
❖ C programming language offers lots of functions that consist of system generated functions and
user defined functions , C Compiler comes with list of header files that consist of many general
functions that can be used to develop the program , while the programmer can create the
function as per their requirements that is called as user generated/defined function .
❖ C compiler produces the machine code very fast compared to the other language compiler .
❖ C programming language is portable , C Language setup is around 3-5 MB , So , It is very easy to
install and operate .
❖ C programming language has a low level of abstraction , It is close enough to system hardware
descriptions , you can see right through it and stare directly into the machine , learning C first , it
is easier to find your way around how higher level languages work .
18. Disadvantages of C Programming :-
❖ C programming language does not support Object Oriented Programming ( OOP ) features such
as Inheritance , Encapsulation , Polymorphism etc , that’s why C++ is developed , It has no strict
type checking , For example , we can pass an integer value , It is for the floating data type .
❖ C language is a procedure oriented language , So , You should develop your program using
procedure oriented language only and you have to implement any algorithms as a set of
function calls .
❖ C programming language does not offer support for namespace like C++ , Without Namespace ,
we can’t declare two variables of same name and you can’t use the same variable name again in
one scope .
❖ C language doesn’t perform Run Time Type Checking , It compiles time type checking only at
run time , C language doesn’t ensure whether correct data type is used instead it performs
automatic type conversion .
❖ C language doesn’t have the concept of constructor or destructor .
❖ C programming language does not offer data security .