Sunteți pe pagina 1din 21

NOTES

NOTES

Programming paradigm

NOTES

Paradigm means organizing principal of a program. It is an approach to programming.

Different programming paradigm


Procedural programming:-In procedural Program the emphasis is on
doing things rather data. Following focus points about procedural
programming:

Emphasis is on doing things.


Global data is loosely available to all function.
There is no data security.
Procedural oriented approach does not model real world problem.
It does not encourage reusability of code.

C --supports Procedural Programming


Modular Programming:-Large Program is broken down into smaller

units i.e., function (sub Program). The idea of breaking a into function
can further be extended by grouping a number of functions together
into a larger entity called a module.

Object oriented Programming:- Object oriented Programming

paradigm is based on the principal of data hiding, abstraction,


inheritance and polymorphism. It implements Programs using classes
and objects. It supports reusability of code so it is very close to real
world. Data and function are encapsulated to ensure data safety and
security.

NOTES
History of
Language
The C programming language was designed by Dennis Ritchie at Bell
Laboratories in the early 1970s.

It derived from a computer language named B and from an earlier


language BCPL.
As the language further develop and standardized a version known as
ANSI(American National Standard institute) C became dominant
This language was originally designed and implemented on the UNIX operating
system on DEC PDP11 by Dennis Ritchie at bell labs and entire UNIX was
written in C.

Features of Language C

It is Middle LEVEL Languages.


It is procedural program.
It is case sensitive it treats upper and
lowercase differently.
C Language uses Compiler for translation.
It learns basic programming skills.

EXTRA

NOTES

EXTRA

OR

Preprocessors
EXTRA

EXTRA

PREPROCESSING AND STANDARD LIBRARIES

It is the directives written in a program.

It is always before the main().

It does not terminated by semicolon sign.


Most useable when our program are more Larger
and has to managed multiple files.

OR

Preprocessors
EXTRA

OR

Preprocessors
EXTRA

Stdio.h
Scanf ()
Printf(
gets()
puts()
getchar()
putchar()

String.h
strlen()
strcpy()
strcmp()
strcpy()
strcat()

math.h
sin()
cos()
pow()
SQRt()
tan()
exp()
log()

Stdlib.h
malloc()
realloc()
abs()
free()

EXTRA

FILE INCLUSION
#include<filename>
#include filename

is

also

permitted

A Filename written in < > is searched in its standard

library.
A Filename in is searched first current directory and if not
found will then be searched in the standard directory .

EXTRA

COMPILER CONTROL DIRECTIVES


This is the need of developing large programs and
to make the code portable to more than one
specific type of condition.
The control may change the execution path
depending upon the current environment.
NULL DIRECTIVE

# -> has no effect.

NOTES

NOTES

NOTES

NOTES

NOTES

NOTES

S-ar putea să vă placă și