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

Introduction to C

The document discusses the C programming language, its history, and key features. It highlights the evolution of C from its origins at Bell Labs and its standardization by ANSI, as well as its structure, syntax, and data types. Additionally, it covers the compilation process and the use of comments in C code.

Uploaded by

anantwork1997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Introduction to C

The document discusses the C programming language, its history, and key features. It highlights the evolution of C from its origins at Bell Labs and its standardization by ANSI, as well as its structure, syntax, and data types. Additionally, it covers the compilation process and the use of comments in C code.

Uploaded by

anantwork1997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

(

C-Lamguage
Denhis Nitchie aud Ken Thompsen at
-

Unix OS ccan itten by


Bell Labs,ATT. PDP-7 CHo Plodetom)
toitten u Assembly Laupuage to
Unix coan
retoite Unix iu High-level
coadcd ta
-

Fen postabili t they


Saugurg creeted C-lagu ge
Laten Dennis Rifchie modified B oaud

1972 1943.
citlen in C by
the Unix Kernel wan
-
Most o )establisheed
Stcudads Instikte
ANSI(Americau National
-B1969 mnce theu it is
called
C laupeaje
aud
staudancn fo
Called an C89).
an
ANSt-C (albe Cvaainadio)-fwdhan

staudardo
C99.
Loodig te
1 9 9 9 , T S o ( I n t e n n a t i o n a l

Tn nes featwn
acded
evised Caud pogammia
dor Sttem
deiqued maùn
Though it
coan prammiug
uned fr all tbt
cwvdutly beig
it is

Featw C laugnge
Keycoeds in
a
32 keyoerd.
Key«aad-Cha e tak u h lausua
O Fece a pedeinad
is amigned dont thougha
CDed # a t u C is
O a i e n t e d - E v e y t h i n g

usitha
execuutien
Fnctien itp
Bogram i t e begim pogam
i
onten as a

huction. Entive
Called
main".
cemplen
puosidoo noady
uciom C
uctiour.
Evey 1ho hammey
s fuction.
collecien
Caled a
bult-In
made suctiem fuuchieur
unt-dejnacd
CTeate
CO
u ane
Tis allois pioqaUm to divida
Stuctwud Lauuage bamc Cenctrel
iuto modults aud puouidts al
pogc suoiteh-stedeweta
stucues üke i, forlsop, cil-loop,
17 meaus Capital l o t l e
Coneeuihive.
Sentive-C u
Cae
mall ictten.
an diffexut fom a
the dhta-yhe
We cau chauye
6Weaklyyhedtarpuage Qud vice vea
itegfto float
the pucgaum. dem
þerforma
may
oheatoaa,tohich
operatorkChan
Rich u
t - , / , * ekt
Nnglt speatioua like
declae away olo olemests
We
aud ever prone
mas
doso.
Liberal C allois un to
l1h elcmsut of t .
aud accen

Editem + Compilon
Develepmtuct Enthervneut)
=
IDE CTtegaded
CodeBlocka gco-setu)

Rum
Stuctneo a Coqam
tion
Include headen filo sec

Global eclanations

main C)
x Commeut x/
Local declanatiown

Statemeds

Utn delinad fuuctiouo()


Local declaatious
Stateueuts

Filen iu a Coaam Seunce


seuw cede
The Fla
exteuien
o aC
OSounce file
f l is '.c' pradied
centain t a mt
f i l e -Headn fle is included sth
Headn quctieu.
Tt
staudand übiary Al t eoaden
include.
divectie t
Crepecemirg

exteuion.
a .h
Loraue

is Con v e t e d
te Cbject fila
Sowce Coda fila
Gbiect FL- exfeuien is ".o'.
Cemhilon,
vanious okject
linken inks the
HA
file-The execuetabl fila coith
Execukablo
a hinay
tile to produce
extewien exe".
cecutakle
byect Linken fil
Senee (Comiln

Libat
filen
Subplied oith Compilon.
ana net executed cenhi0.
by
cemilo the
m m e x t s - Commeuds

thoneloe tay de not alket Aha exeudien pood a


slze o h i cempiled proqm.

C Suhots too tahes ocemmeuhiv


D Line cenmed
Cemmet
une
T h i s is

Blok cemmet
i s ued to
Cemmeut muHpto
Statemety */

Fivst C regam Commeut

screen.
a message en he
I/Program Je displaj edto
incuda te
Cetetsheadanf

include
<stdio.h>
usith main fuehion
# exeutien
twds aud euel
Pregam
main
>
>douni Opsio
osh
te C Language)
biace ("Welcema
print
S steudaxd funetie

Chmacten Coustauts)
(Backslanh
Escahe Sequence a c h n a c t e . This
\Cbackslash) aud
cembinatien e
is a veqiured elt
a maa
te get t e
inseted i u t e
is = uwstien mank
\ a Audibl bell
a
\b = Backspace

eus ün
\ =

Horizortal tab
t =

v = Vevhi cal tab


W = Packslash

SingaSingla quste
= = Deube uete
6
Elemeucts
he C Laguage

) The C Chanacte Set


Letteu Capital A to z
Small a te z

o to 9
Digits
White shase Blauk sace
Hoizonal tab ( t )
Nee line (\n)
d)Special Chanactey- slam

back las
Tld
&Anmauuaud
A CJot

*Asteisk

C)Panenthoir
3Boace
CBrackes

hat »ebarate
text ingr
Delimiteu-
) (Ham)>Preproce Ssor divective

/vaniahla epanator
chage
C C e m m a ) » addhem
statemets
3CEacen)> Scope o
dleclanatien
(Backetr)> Avmay
C
(aneut hein)-> For expremen k suctiom
) tatemetts
(semicelen) > Tenminates
Ccelen) Unelul fer label
There ane nertnved coNd b Compil
Keycconda -
aud cou!t be ned a au identifen (vaniable/fuuction
abhay namen ).

- auta -ele -acgiste-unior


- anedk - unigned
-enum NetUnm
-Cane -extern - s h e t Void
-chan -fleat |-signd -velatilo
-Cont forn
-sizes -de
-Centine gots -struct
delault int
Scoitch -static
-double -loa
-yede -cslila
H) Jdetitieu -Thee ans the namen given te pogcm elcwa
Such a vaniables, aroay , aud fuctiow. (hey may CewAst8
nstaleed.
au undenScona. FiYstdigt
Qu alphabet, digit, cr

e
duwung
is a vaue hat deea nst chauga
CCwtauts-TH

t legam cr escae eqmue


exeautien o Cewtauct8- Singl chanacte
a)Canaeter
enclosed
in s i n uetes
A , '\n
-200
Cewtaute lo,
C) Trkegen
ceutauct- lo.so, -200.S4
CFloat

-S Tis is à stin
Shing Ceta
valua h a t may
clauge Ttmut be
Vaiable is
a
6)Vanables- aud namt
declared by its datatyhe

HDota Tahes-0Tntep Dataty 217


Zi) - (-2t e
iu to 21]
Zd en
Signecl(
Shert I n t y
to 2]
(a bte) Urigned (7 u) Co Longust
C-to2
signa ld)
ngindeg& u) o to 2
(4 eyte) sigue
T
Keyuod
Kegwasc
S t e

Daayhe-- to 124]
(7%c) Signad -128
chan (1Byte)
Chanacle Uhwiged lo to 25s]

flect (4 Byte) (%f or og)- -3.4E-38 to 3.4 E+38]


flebth fo

gbuhle (8 te) (%4)


-

|-17E-306 toI7E+3o6]
te i.lE14332]
ongdeuble(toByte) (L4)- [-3.4 E-4937
Cenweuien Chanateys
Roy
Sne (Fomat sbirg )
fermat opLhen

dataiyh eyeero

Chanadeu ame utd do indicate te paintf() aud


( COnoeNen dealing
te tyhe Ualun Hhat use are
cau )fuuctiow
ordler
cetain
execauted u a
a
Stateme ns auucion
Stateniuty k bodt
ued t e
cewtuck
declaatioue aus
and ane
is made up o
juuckien's body
A categees
3nmaiu
statemeuds
Categovied
ju
dacision
ued u
an
Stotemeutz
(Seloctien)
Stetewauts
Cenclitieval Soitch.

O m a k i n A s i t u a t i o w

, C

pato
if..ele
) erecute
a
a)f -uned
to
S t a d e n m a u d a

(Ttecuhive)
de-colil Lco
Loop
©
lils
Jeop,
loop, ) sletemats

C) Jor
pato
u u c e n d i i a - a l j i

an stha
Stateneutk-Tek Je te
en at
Conthel rom
Juw
trane tA
Uned to baeak.
HCortinu
,C)
a)gto,

You might also like