0% found this document useful (0 votes)
7 views

C Introduction

Uploaded by

S. Prem Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

C Introduction

Uploaded by

S. Prem Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

C - Introduction

Dr. S. Prem Kumar, M.C.A., M.Tech., M.Phil., Ph.D

Professor, G.Pullaiah College of Engineering and Technology


http://www.infotechcomputers.org
TOPICS

01 Overview of Computer System


02 C language Intro
03 C History
04 Features of C
05 Data types
06 Structure of C Program
:

Overview of Computer System


Computer

Hardware Software

Application System

Packages Languages Utilities


OS,
Compilers,
Interpreters

Low level Assembly High level


C - Language

Introduction:

C was developed at AT&T Bell


Laboratories in 1972 by Dennis.M.Ritchie.

In late 1970s it began to replace the


existing languages like ALGOL etc.,

C language is reliable, simple and easy to


use
C - History CPL – Combined Programming Language
BCPL – Basic Combined Programming Language

Year Language Organization Remarks

1960 ALGOL60 International committee Too general, too abstract

1963 CPL Cambridge university Hard to learn and difficult to


implement

1967 BCPL Martin Richards at Could deal with only specific


Cambridge university problems

1970 B Ken Thompson at AT&T Could deal with only specific


Bell Labs problems

1972 C Dennis Ritchie at AT&T Lost generality and restored


Bell Labs B
Types of Programming Languages
Imperative Programming: Imperative
programming languages are composed of
step-by-step instructions (how) for the
computer. They describe explicitly which
steps are to be performed in what order to
obtain the desired solution at the end.
Structured Programming: The program is
divided into smaller units and it becomes easy
to understand and manage. Ex: C language

Procedural Programming: Emphasis is


done on doing the things, i.e getting the
results. Ex. Basic Language, C language
C - Language
Computer languages:
•Problem oriented languages: These are also called high level languages.
•These are mainly used for faster program development.
Examples: COBOL, Pascal, FORTRAN, C, etc;

•Machine oriented languages: These are also called low level languages.
•These are mainly used for faster program execution. Ex: C language

Note:
•C is middle level language. It has features of both high level as well as
low level languages.
Features of C Language
•C is a system programming language with which we can develop other
languages, packages, operating systems, editors, linkers, loaders, assemblers and
utilities.

•C is a structured programming language. It follows a methodical structure to


develop a program.

•It is strictly typed language. We should define data type for every variable we use
in the program.

•It supports high level programming as well as low level programming with the
concept of Bit wise operators and Interrupts.
Features of C Language
•C supports data structures. Dynamic allocation and de allocation of memory is
possible with this concept. The power of C lies in pointers. By making use of
pointers we can create linked lists, stacks, queues, trees etc.,
Features of C Language
•C is a function oriented language. Supports approx 300 functions classified under
29 header files
C - Language
•It supports file handling facility with which we can store the data
permanently on magnetic media. This facilitates C to use in
commercial applications.

•C is basically a scientific language which gives single precision


and double precision results.

•A C program can interact with external devices with the concept of


interrupts i.e., software interacting with hardware.

•It has readability, portability and correct ability.


C - Language
•It supports graphics and music.
Character set
A character denotes any alphabet, digit or special symbol used to represent information.

A, B, … Y, Z
Alphabets
a, b, … y, z
0, 1, 2, 3, 4, 5, 6,
Digits
7, 8, 9
~`!@#%^&*
Special symbols ( ) _ - + = | \ { }
[]:;“‘<>,.?/
Data types
Data types: Data types specify the type of value that a variable holds. In C, before using a
variable, its type must be declared. C allows 4 primitive data types:
•int – to store integer data
•float – to store real data
•double – to store real data with greater precision
•char – to store character data
Any variable declared in the program is stored in memory which is a sequence of bytes.
The size of each data type and the permissible range is given below.

Data type Size (in bytes) Range


int 2 -32768 to +32767
float 4 -3.4e38 to +3.4e38
double 8 -1.7e308 to +1.7e308
char 1 -128 to +127
(256 characters – ASCII)
Data types and format characters
Data Type Range Bytes Format
char 0 to 255 1 %c
Signed short int -128 to + 127 1 %d
Unsigned short int 0 to 255 1 %u
signed int -32768 to +32767 2 %d
unsigned int 0 to 65535 2 %u
signed long int -2147483648 to 4 %ld
+2147483647

unsigned long int 0 to 4294967295 4 %lu


float -3.4e38 to +3.4e38 4 %f
double -1.7e308 to +1.7e308 8 %lf

long double -1.7e4932 to 10 %Lf


+1.7e4932
Structure of C program
# include <header files>
# preprocessor directives
Void main()
{
Variable declarations
Initializations
Program logic
Output statements

}
EDITORS of C program
Turbo C
Turbo C++
DEV C++
CODE BLOCKS
NET BEANS
Visual Studio
Eclipse
GCC etc…
THANK YOU

DR.Goal Setting
S. PREM KUMAR
Observe [email protected]
| Inspire | Adopt | Attain

You might also like