Introduction to C Programming
Introduction to C Programming
Hello World
maln ) (notn )
+inclode<sldioh)
nla,b,e
o-l0, b 90)
priat( Hello tsold" ):
roton O,
nym bey is Even or Od
) whethor tbe given
#include ctdio hy
void main() Edoeotion is the monkodlal1on o portodi prose at
alroy in man Sstovni Vivokanorda
into, ic clorivod fom ololin word menn;
{loosoving rneoning to rorlbub.or device
put (/d is everra) Lngner Deslgn, Thoblorm zalving
ele Efecl
oidt (yd is odd\n
nes i de Come! cuddonly and in oralher inhalie
tsy bul illoston is nathin4 bul thoouttoma af
ndute ldioh eorlier
ntellectoal Cipenen e
wikipodia defines irehrolog o" Tho seientr
uwhich i 1he o tehniurs ,ckill, me lhody and
fprocosin ucal in the produlinn of qoud, g services or
o)
(CC Lab Condiio Itean),
cho()> loclar
, ’ Save
C= at b: prirt{vulwesof a and b
are Yd Yd,a prirl ("The may is J.",a);
printyalc):
Else
asb;
b:c pritt ( The moax iu d",
find the max ot 2 Num bo printf The vulses sf and tor Lospi
b atter
Hinclode <stdio.hy exchange Yd a for Citialition, condion , ineremanl/Oecremorl)
main l)
i ab;
slatemeat
t Condtin is Fo lse
printt ( The ma x is a Aa)
¬lse
pritt ( The may is b Yd", b) con dition is True.
The
De peuds (oop)
order in which
is the ordei of
we
plae tea stete mot phyota
execotiorn t these stotement
t+nclude sto.hs
* Tnner mort () ore SUmO
ntab,edef;
Som o N nau,
Jte a proqram Cp
num bors
So
#includeestdio hy
main C)
high level langua go wth lou leve longuago we hare to espeaally declare +hat type o
festures langage is called shongly typed longuago.
Hiah level c Strsctyres - Records
Unions - Sinilar tostroctote,
Asembly languago. > Sym bohe odelt)
Machine language ’ Usinglk0 Pointer bsed to allocae memary dynamically
Can have control memofy osing pointa
’ Most ot the Complex sottuoes are cori tten jnCt
can be acheived
"Eieieny only by c+t langog. Used to lou leel languag e.
which are
C langue fettures
Ertemal Librany We an.use angting
’ C is a rsctoed piogram ming lanquag
o
C progtam i portalble ’ Com pìles ts Native code ts
ster
\earningIonguges
to lean
C:
something eke
’ Maco processod : Symbol represert
Sya t C Pogram
General
C>.exe fle
dive tie
ttinclvdeer Hdetin)
precesso D:lerenees betoe en
Pe
main )
Asc+ UNToDE
Declovrtve sttemt XA charaer enting * A om puting ndotr
standard r Drsitert
ERecstable satemat stendard for electro
represertetion
Communiaton
n mot
tert ex presse
Gonveit C.exetrle coorld's writing syetem
X Starnds for
Ameriian stands tor Universol
Peproces sor le character set
Souree tle standard Code tor Trtormstion
Slename.i
flename. c nterehange
Supports I28 characters Supports a aside range T
Compilaia,. characters
ond an
toInstntegerans iderti (oModt
ng tieryspeasre
exprerion be const
operas otf ot
workcay voriablebyiderter
followed Conctarts
oporate pegam int program ahose
the inta,
awhose Plo
Reserved
words
chenna'"
to.8 val'
Combievalundtion af value does
atton Unig
valyes
name nt
o changemoy change
Comhyby
shch
pera
changenot
Const Sobetrtte
r Sybohe
constan:
4define preprocessowhich constavsUodto Declarotive Shatemerts:
delare Prov'de Evaloation Compic kil
langog
db3at2C=
int
Lor
ita
an operlost,)
|shoub
a are
Dntormai Can
invesutd
l0, diredive
a altlhowsat shoul
nl te dotivos
URN
PAGE detine d modtlicon
seq ...e resutim
Variabla thoybetoken
oracton They
toExecstable be
when *
uene cblssitied have valve
albe i is
evaluated result ew
of st any ot inoperato;
substtute ahorates vo in
some into ide variab valve a
SC luey
#deined isa
d is
name a
Gthexewtion
statemarser the otcortal
ehich
Those 3ty
etcu lo \:ko
firat ved bt
pes shoulA,tno.
atte. the
thu val
deline delive #
nomeevl
oaluolion
blorethe
> PRoridone
1Rule repiuurvt
ronnal
droelly tntanl.
ewlol
(num
we wis.Brl
Sob
exewledeyplecs)
Opentlor Aciynmral IngkalauonalArlhocheRe
lernory
\h
apply
on Assoc ohanla,hesline
opert a which
alive
lhe lor
imne fule, cloperalon
omol pretidene
chould
level per
lha
’ Ahemehe
Athmhe
(+ x)
Relational Otpud Troe/false.
loqial value.
Out put has bgital
Ois
true
ther than
Anytng Termarg Operelr
false O
Iroe othorwe. General sytar
T TI
Enginering
Asiqnment gparato ’ Enginring kderived trom ihe latin ingeniurn, meaning
+= leverness ond ingeniare, meaning to conthive dovise
> Engingering is all abo vt design/ problem soling
LH S reterence d Thee can be alternative solutions. The best the
RHS Îs de-retevented
în
programming langunge alternatives to be chosen among
’ Ex periente Can be a boon or curse
13rtsise: They sontor bit leve l (&) y Resoofces to be used eticiertly.
are
’
Basically,they
kolutions
do hay
tonoture. is methanieal
Irtially >heading
the evolvedComputer
inQrale kol> 5
Tran
There volhigtah.Compute
geand machines.
Next
Consited f atioAinding Cambridneye Tnduy Tnduty Inducy 3ncdost
nachè
.0 yIn20
clodlry1.0
ttor arnote grooing
still near
eleCro
are came
bm
s phyeianot aso computers towords
fsore
rrayhtch diferent nic ond
ords, that S0- 5.0
4o-
numbersdictincusl
arisyomiprforond.
s machihes qears,
Unlike arnis
ezductcd s yber.Cornpute,tletroni
ae comps aere
wheel:, chines.
mo tor oted Integration
to way;
da's ohich cotlrollinq ond torPhysialIrtornl ond
deline:
Hts ot trnss'rie,
pitures slor
et. re
ro
re. cr
stre ng, machine tom, ord
forond-users
syi
oryraing ws
ren
"ns nyi brors ond Smart
n humanfacore,
sd
’ computer
Today' ’ oayHodag>But, year TBM ’solve
The ’ ()
Alterniating
are
devices
Eletrie eledrie
inerease )
The
the whiQuartom
ch Molecvlar
ompots ike and ’WHto
diculH e trunsitorsthatMoors ’la
Data
computer A s
to are
thé Dol6 eurent is increase govng
have
Dsta Computing
Can becoriond
ng tuo device
diference
the has computerscomputers
expecte double
eyHo
quantum and looking
can inportavt size is
veny
designed com
the reached
redvce
has puters molecoles molecular CanstatethsatHhe
be Consume
the
between lowin
othe toare fonsard
ages,
capable
numbers
lrke
derta amourt
on
is eomputes put (even solvebased replace oapacty Hhesizestage a be
eharactevlstia capabilty. sased
onths.placed
devices more
quarntum
ton
video
ef
thedevice.
eleztronte
supercomputen) some transistors
onon
and
ofo
usefe
IS'mhe
twhere
ot .Theyvoltoge elecronic hich the f
.etc.
storng voltoge
cloud. com
quantum
problems
quanTum
comput er.
ther transisors
number
in
a
bers, There?eare findingaro uni
computrftot ond they puter uth
alpha the a devke availebb computoypes
dsla. that Use. long tn camscomguin ovqanik of
bek and the ohic ip,
af
ok.
certral tixed
syterm
using te com JS
ond
On
a or data s. pute
devices wht programi
Core
andof billion)
micro
Qn Transistor may
volue
electrois
to why Ialhy olko
com using store: stored
elecronc protes cannot maintain
and t
cannot calculatorstke ma
procecor tronsist pornestofa be
olphabels
devcesnic the only kes ohich e
62,S. prog";
maintain the slofe ainside ore
USes
-he dala computer
device orsmade is
ot
4, i.e,digits the
:
and 44 lovoltage
w inand a
that computer the are a data the compuor
1.& S.o,
vd to
oto. o: d.terent
nistors. billlon voltage
4.. taqges. unstable
pre 2
eon sereral usng torm of
cisely
be atansis is why
a tem
intwo exaclly at
e, caundec1ma
o t noT othor
ram oto Computer
diag orehectu)
Ven Nevmorr
Block stord.
(Pondem oress ernary) ord errraret rresr-let
cables and vesiclors, capactor, relays ard The aubseqverit computers are known by their
amponent ineloding improved versiorns fthe
mainly vactom tubes procesor ond they Used wbih
otheheld troansistor and Integrated eircorts. The company is
one fhe brlliat minds called corrtributed to the majority of -the processors
Tuning troduced euhat ts and
conpt saence
universl luring moch Delhith founded by Robert Noyce
universal eonputing machine or Gordon Moore.
in 36.
theoretical computer bot could perb Evolution st Processors
’ The irst micro processor is ntel yoo eohich
compotations. -bl mlero proceJsor.
ot it consisted of atape a
The phy sical model sot 8- bit processors are 8008,8O80, 803S
st sttes, and a reodairto
ef stoing symbls BO86,8O88,80lS6,80NS6
’ 16- bit proessors are
had capakle reading and eoriting symbols. S0386, 80486,80SS6
the ather ot Computer 32- bit microprocesgog
is consi dered as
Pertiom]
SCvence. 13,iS,itondi9
he machine wht ’ Gh- bit micró procesors Trtel core 2,
’ He is the person bohb could invent
wos Used b the Btish to decsypt the .mesages y The rnumber' ot' cores(processing onnt) stared to inerease
t Germans shich yeulted in the vitory ot Allied and allthe cores were present inside 'asingle chip
fosces in World biar . Bot ontortunately. he commitod Cores Can be con iderel ás small CPUs insde a
>As tar as Poceuay technology is concerned, it ’Eribédded 'coriputers are .similar. do weatable
sbeeforther improvement,
reached a staçe where com puters, but the compter s embeted inside
may not be possible. The
physic1 may
the lous ot physir deyiaes ike,Toys, They havecharacteristies similar
s
f hat thert
enor mous amount generated to bueoro.blë ,-com pupers. These, computers ican be
peverting urtha progress . progress can be embeddad.tito'your tbisds also.
viclating the lass phyei
achieved only by
by 'POA t a peioial, digtal aristant shtch has
’ The Gaphic poesor ae being oddod etai arrived be to re iomarlphones. Ihe pur pose st hese
’ The tostue generation proe sors will be baed lerices s t8 store isne peronal intormation. ike
On
odrese't .te. The curent geneiktion rof srharti phores
Quanum Phystes ond Molecular eomputing. have all the , mpabikties of AS and hence they
are rarely used now. lhese are hanheliderices.
sf Compt
Wes roble eomputer s) Notebo ok > Smort phenes ore handheld -devices hat have npobi
y Embedded eompter . close toyesterdaye .desktop compoters. Moie imporlaf
itha proçesing copability tismartphones itreaing
ropidlyhey have memory .nto ohich, nes prgrams
(PBA) n) Workstation Gan be logded. he main problem wt,
Smartphone
s) Tablst
I Server
) Mointrame
hem is the Sereensi, ohich is relatiely small and
` nst sol able for some applteátions." Bot, Mthe uer
) Hecd morited is satistied th H'S snall sereen size, then smavtp
) Thin elient
duplay: (uko) )Qvauhum Cnrper provide enoromous
being
1s) Maleculor Computer eter ively ued tor Video baced applieations.
come uder he lapstóp ashe tncdiret
’ Hood
maunted
Raolh
displous
deves support pei
not oy
de
e
ipheral
oleg computo
and sed them,tho -torrm
p'ared
J
suppert tooch
dont bave two screens
on whth
videas. Two
screns
Can
sepevated by
are dipay
tet
a olso hare batery suppot which
They even ahen he poier gses
Ihey and AMotion
eyes. pre Users compotevs in he fice
images sinilar to our
Ga2c. contol. The most widely used "conputers iey hove a
few mehes them by facilties environent 'are Desktop
interact aith feed back keybóardand mouc.
avalal. abinet monitor,
are
)
’Each 5 -)’1U'è
-> HDD: prgnmae
Erosableand
Data Geneally
block f Eack 1t dyuomic
chrononSun
sk is a
PROMMasked
( oM SORAM
is ditolleeltorn RoM) RAM
block
sam permarert (MRo)
rooding,
i's divided
ever in
draggin RoM Dyromir
slored
evng (Eletrically PROM
(Drogrormable
EE pom) PROM
RAM
*audio shich
14
is
* * various * Os, E
Compiler, *
Dt
Word
GApplssttare:
iaTtiston Theydepend empurps
them.Systan ces.
Appicotionputer'aidcom e
sottare
required
fisa
System Sottuae
Gontrols
roms is can User
the application loader.
linker, Convers
more
player
beproceior, mostlyenable sstware
comprler
which eriten carmea' ssttware softsare
to Codetey
Source
wrHen is ohrch s Debugger, S.w
Trandlaclor Sydem
Appliatnr
soy
we byspreod
ssttware. wrte
write any ralated
difeentfor
highy isápplicatons.
cheet, usng Tnter
proganmin ethcient ofaiet the
softesae
relatedto
to
can -paint, OBM various c+t. User pretr,runningfor
programu.
featu
be
man'y f. unningthe
Uses
photishop. Vipurpoe
S, Editor,
calle langoagt. dappieiny
eo diherentfor
player, A-S CM,
a
)(ipeatae
1C
a|
oty, Somal langvag ata and
sQL langoagc
bolt tock conruelron
eode
longvages Sym 1¬o Sinay
lerlalerte languaiges'mÍre- tim. tme. Dtermeslat
-objetode/
CneandanO.S
alsa pmgnmmihn -languages a ata
prayranmabe have at vas
swhking instutor inetoetiYn
on code/
Machinelngoage
level- Astembly code it
gore but objael
Non- High- 1
mtShell Progaiming allon -to- an proceu
Comypvte to
acu Tonvert ads SameLine
+T4 4TH
+ *
el
L,
sleh. case tonst cip3: datment 3
*C loys supporl o
wieh sysem.
slrlemewb dowhile
* whenthe etpres doesh m
ateh with anyons o
slatemont stotemol,. dolout .oternat iteetutod
Undhaand poganning qoto
ls Jomp pognnd goto label;
label; slalevenl
int mainf
b 20
(: 30
goto Som)
d: at b;
Sumall::atbtc
priktf SomtsYd, sum)
’ stelsel
stutemeu t ladder ia long but upon
becomes reodable
or more