a
S
Programming
Notes Le
KK
UC) Learn Coding SC
aw
p ilesh Kushwaha
@akhil2k_Ic © (3
Ankush Kushwaha
@ankush2k_Ic (© (9Oz
| aaa ain
Boss Cis o middle level procedural Ovients
——‘Pregrarmymina lay e develo ee lay
a ‘lpeene) a ws Ridchie” al i
bell _labovalowes th the year 1932 in US
Net = =
Sears Compiled mon e 4 whith means _
pe that preg rane 8 covittens in Cave transloted
___ivte eit Code before they ow
|S erected Svea On hele
1) Cha O Nelatively Smell Sef of keywords —
Ond Syntax vulee , cohith maker it a Simble
Nespas | Jeavh Od Ue
Sit eG algo _Knowh for ite porta bi ity -
History of C_ language !—
aa 7g
| O_Depnis eitehie Joncated 10 on san wert nad
OF B__-Breqirommning leahauage » uohith wae
_| itself a J a J soot éd_Versith
| of the Bea Gd
Morea puree of Cas _to_davele fp the
ee Unix _Ofpera tin tom, cohiel rn
25 ot Bell habe.mo ) The fist ve _Veviien une? 6. Cane
S| o__SrcT expt aesebaten © UNir
el oe ster as
OS Vk vom nihil filled "Nes ta" bal but was
_| loay wenomed ‘0
SiC
OC preqrammminy offers Several od vantag et —
El mance enue
— ) Portobili roe
sn) lexi bility «
Ww) Mo dulavity-
v)_ for - level Safa
__vi) Simplicity TS
wi) Easy bh‘ Jearh «—|—machthe code erected by Oy Computey:
__tnett Commonly Used C__Campile
Ie heed & Compiler that Cah tran
C__ cae 7 inte US iy nals ee anhy
ec ie
aaee Vviswal O44
ase Cat
| Soft. 2th ogra
| Inle__ have Inany Vaviely_SePlaniet ta tan G a
Ee) bey | CHp
QD VE Code .
©) Tarbo Cats
| | @aSeceenttee
SAY) Cxeuibable de clara ftir:
teuchyre ef ¢ language y=
—= le Line Comment
MMi Vine Corament
Ci) Pile declaration:
nD Utlolal dec larratisn:
ae ret_ | AFinclide < $4 dieshS
ie
al rt CS fone pg):
—
Com piladiin 7 Exesubin _procere of Cas Pasar im
Fist. obdl
av
Livkes (R21 objet filer & libvence)
Fin. exeOQ
Ihat 1S Variable ? Pull _oxplainakin
fy Variable is the hame ol mnemoy ‘
here __te_Stove tagretsieved ond manip
ana the bre mi
Nbte= A Vaviable ig declared with ham
pe —O data type
| yan fet foc=ito a a tenenpaoem
DSS
al dstaljpe — vawiable
Rule _4de_declave a varidble t—
A Vaviable name mut stevd oith a_leller
Ceither uppercase Orr lower case ) n .
A Variable heme Can Only Cohtarn
ie Ond Un deyStere »
w) woe Can a Pra Spaces lnehoeen the
Nawable:
_[Y) Vomiables ove Case- Sensiliie 1 laRate St ony cxccessible sittin the Sun chen
a block =
Gxample'— DO, a Func)
i =\o; | local variable
‘int xeto: [local Vvawtadl,a
Nob =O State
———
Until the end of 4h Ca
Cegpple!——_yola amc
__ ia
- wna"
hd", Count } +
Count + +)
5
it main 2
j =
Band! :
eons
Punts
a *Data defines the 4
Meang a i kin d of va
{—_5" Shu etre
t——> Urn
——— Prey eterPylinny —_Deseiphin _ Side.
je pre cisish:
| ae eae oh mnvst
= Valves, of the Systems.
Float | sed For Floating | Typically + byfet.
oil ‘alee esis E
ae Wied for £ lonley |
>sint Value usith F |
double Aye ciissn:
|__USed i
havetere
i
Noid | USed for to
the absense of c
type:i
1S nothin reas -A_Yalue that _Conot
be altered by
the a eae tan
= > Const 4 a._keysoord «
_Nwte = OD Cowlt Con be of differvest Axper
Such os a Float, chaacler ote.
‘idan lite
Note De __Can'f use _keyutovel a8 O identifier.
Cuamble 1) Int a= lo!
le eee
pve 1G ae,
1 Ca
mi
1) tnt ‘tnt £19!
valle0. Whet 18 Keeywoovd 2 Fall exp ;
S keyword ig Sethi ut scesevved ord ,
__| —uohese _nean) \ erltecaa —difinted a
he a Compiler:
_ Note) We Can't Use keypad 0
_Newjable name , Pn clie
SxS int Float =19/
= AS Snvalid
Stale
ShweO [Anlhet 1S Comet ® Gill explainalsn:
poi -Cominents Tere) uy eels alum aster ere
_|—_erploinatisng +> the Qode . __
[+H Astolty Syneved by Ah Compiler omd
es eat affect y _the cele ae " She
| PXtieote fo we Camnenk i
a Der ere vnove_*Yeadable «
I) Tear oa eee er
w) Dad atte aie detail @epliinalen fev
_othew ie mart cath may nerd he Code
= a
at z >
wy ab
te Qemwrend Maly er
oe js i me = =e 4 SS this 4
a Comments voulli- Ine
Comment
+ Sele int ole If a 1s a vavishle.
pe [e_Cneste _prvesram
Foy ade
- 159 wlan 2 /Bipe_ Ces shell = eee
18 ca vais: ble)
Joma Hers
| Qeamplet= nt ston
ial Flead h = (Pleal) a:
[Note = Ht sed hen use outinh a pale of
one _data ty
\rov table, Can treewit in ee ae
datate aveit Mut -preblem }
Deu be ihnSe
C=
= C Pree caro ming
.Ihat 1,5 Obewely 2 Bull enplina bom «
pe Ly aN ‘1S Q Symbol __fhat__-p ero? _O
Specie S-peratien? On An _ operant. Z
DC TAS ae enn eee
we aaa Otersfore 1—
> py ec rererspor
> PRelalronal of erator
- ee Sfoeradter «
= ecto a
Indvsment | decrement Sp eraber +
Ws Ternary | Sperber «
@® Pyithmelié Obeva bey t=
Deithmehe ofperador rev forma Ovi thmehe
alas
Operaheng Om numa mia
| Gxanglet= OD Psy ben C4)
D gubtreecbin (-)
OQ _Malkplicatesn Cx)
Onin, on a |
OD Modalue cD)| ae Qz—
ee
— D Related os
TRe late Sperator Compares 9-0
eles ano ree byrn, ae lean ehulf
| Graneple i= D end ogusl (==) J
e —_© net equ Us)
JB OC _aretter than CS)
| ore |
pe} == seater fhan oy een?
L Qe han ov 4
a
F|
[Sot a Cpa
coh otserntoy 48 Uted bo perform
Leet operrtvong Oh _dyaolenn
ex
Cromple t= Obagi? AND Cas)
pe a OHyet or Cu)
oO 4 oP wor CY)
E
LSD Desi gnmant _Operabor -—
Jd
Pssiqnment Spenater 8 Wed hy assign valves
evans a ble ¢
Qrarple!— Sti tod C=)
aa O_ asi wet (+=)
Bl Q Home et (-=)
el oD Pelliien met (x=)
Ez O pDivis» } sige! a>
L OQ) meds [ug Assays nerd 7 weia per ng
|@ Ingrement 9 Decyemet oberaby I=
Increment Operate} im
Increment oberabey 1S Sted to ‘imevente the
value FO voméble i
a
a I) now, i has a valve of 6
LE Tie = =
= Pre Hincrement Cea)
Se Increment C 144)
| ©) Decrement Operator 1—
a Decrement operator 18 Used bo eae
the value | sf a rancble_ ————
Gea ple! ‘int _
| j IL Noe, 1 hae o value ofa
The?’
= Pre a decrement teal!
SSS eee ern oan +)
Ee [evnary _ Obbera der i=
“Tevnary Obe: aby pething ad 3 horbhant Day
e Seer eae! latemens » |} al3o kreon
| OR } Cor dipih oprereror.
L 1 @rangple = (AS 6)? Arbywh C_Paroy ates —
Q_What iS Conte! flow 2 Pall en -plaj nadia
eas Flo cefe te the ovder in ohh
the _‘ihthretusny fo Coie Ore ene cute J.
Com half laws!
E > CandifwnP Statement
p-+— Trans ber Sta foment
sl = Hevalive Statened »
| D Condilis0 statement i
L Condi tind Statement pething ut otters a _-pretnarm ,
| ++ neste 0 ie eee (
} Code ob olen A _crvdatin Com dibaasn
8 i
[| Teves ve aye eee ere Det afpeeeee!
| © Wf _Sbttement = H execaitet Oo block ef Code
EB only fy ely, Ji fee
4 “i = 1S Awe +
LT ype = Flowchart
LTE Cee HHS) (c=)
al - JP bloc of code : Ise
— a ra
———— =‘sed _-}s_ execrte 00 Stnfementt either
ee Atatement OY __ellte _$ fhlemercl Payor
= ae Sow difrisnys
|
co comida | om
m 5 IL statement 4 =
if =| aa
Bd = = — 1
I] Stateymend 2 | if blocte. Ise block,
f= =
© elseif Statement !—
MS ses, eae eee ee
i ee fine __N Siglo black —sit_be
| Creeuke +
Lg yptae = Ge fCemdien)
i; {tee
i= ele if Con dikes )
a Nees
Be 5
Se
a a
qBl nih TNE alge iF
Baroy
i fase ————
= Crd! | eke iv
2 al
EL! Statemed_/
Se
EE Se
LD Nested if ¢ batement i=
L_nthenever use dePthe if statement ‘Inside ths
IP Sttemen ase define omether if block
L Called ested if.
— Syntee F Coon boa)
e if Cons pes )
3
it I Go de
3+}
|
(Dye HUIS sed te down Cankel eo
Thin the
—lobeled Statement ot
ie
a ite label 5
a i er 4
Oo tdentifier:
Geample?= nan)
| nt Jal
aloe) s
a8 Vint PU heavh Coding") *
nee
if Cics 5)
ES)
4 ae labet:
feat teloement is a Conbe|
Statement used -bo exit from
Current jhe addon
|_ Gromble!— Pov ists je=5" 444) =
3
# Ue=5) 8
2 seven:
_abrintt (upd!
[ouput 12.94
(oof Crd june fe fee
‘itevalion of loch
Por C1 1<=16! itt)
s
PUES).
n}inwe :
3
sprint? Od" 1)!
ILowtpt 3
12346 434 Joni Nalin shifement 1S ured be _enit
a Or Pane Hom a day
L 4o_the ek Apoin fs
. ee
0 1 2 34
wl © Syster~ data Npe om-hemel Sized;
= 5 Ceample— tnt __ ow E59?
is a en
10 20 20 40GC Pre alo Ming
ig shigg ? aiUee 2 ree
ae Shiy is tole — ul Sequence of _charartag-
exqpablet— char S34 9="fearn Coding”:
Netes a alton Shine bye trull_ charac
y UCD Re ere wie
end oF i oe
[tat Sy © ate vse Can handle
=| a ore Stites?
_| data +
if ‘ ample SD fake Use input
| WD print Shay in the frm of
a
Go) ne
i ner
Ee vy) ae
ee) ool ae ss
QD Comme
| D tle Can _algr me AF
ie lke —endigy inpad_ fron 1000
vin 0" ve pty) | oud eS Jo
Llathy sponte, =
| ) Woe ean Sie manips late 0 y
Ko) ‘1 z vile moe efficent
peda Nand creste data ghuchire Suath
OR linked liste 4 frees.
Note = CD Iwlhi wh sil 7 ie __herd __
| = Ss
uo: —____Unary/ _obandteor i
> D A —> Apsrey of operator.
“ @ & —> Value of a Dares opecstor
C1) Sayfa Jota type se Var name
El _@xample'— inl _¥ phy;QD) Painter rentable cum Wie eet
ee eee
—Gzample = Vaid Saonin ply)
xply = xpty + pty:
3
tnt _ynain
iv) num = Jo!
Sam (2 win)’
pvp a", num)!
cre kur 0)vd “ea ig Cate) void
z MO Ht Crp bold any type of odcres.
© Piltp known ag canal pointer
py J Ul pty)J on ming ig. aye doubt that hot
sie 40am ~betnany us
= See
Sante — data Wybe x vayehame = ,
Nek OF wilialige —coith nloye Value
J __Crarmple— penu =
int _xepby = ULL!
prin (8'/.2""_ piv)?data type Var ame *
ll
i ine)
‘nt _¥ pt
spr OL ope )2 ee cS ee holis a odd vss
ot ___cans ther eas variwhle Calle
| bowler te pointer:
{ Syplo— data type ae vere narme
| Wete:= CDH 1S alse knew a8 Jouble tsi
Te declaration of peintn be
— . ith 00 atfeviskt(**).
| Gxample'= 8 bind)
int r= 1997
jnt x phy = Xx)
jnt Xe pp = 2 bby"S$
int x d ply =e ph
soem? LS "d= bhy )W) Dee a
—P_ pointer variable that hel2t she a Jdvers
of Pmelion 1 called Tungtn pointer
ster data =ybe (+ vey= hme) C2
| Gxample= int 32 Lint x, int Y) =|
Teboh y+ys
rain)
int Gp) Got, int):
Aly = toadd?
wht sam =Lepaylies 2)
Aaa Ca Ory
zs
z
= 3
| —_“> Storage claws e
ioe. Iifelime of on \J variable
C jor
ma ute =
Lf Regist
| = | Static” al
= extern
1 Memory | ePavl Cope | _liPeliene
cle ale
aute RAM gas o'thin {| ha
block | bloek 4
s active
ister qister _| 2 within i =
iu iG a es
State RAM ere | ual thin Lill the
| block Ley ner ade
— }—____of bream
exvtem | RAM. aro Payohers
in uy
Bir qinaa a
outs vet os ioe
juste neon
1 int i= 10"
PIMPCUWI AI 7I" a be),
Ott,
44?
Fe ule ae
ce a = ae
S10BAS in a ewan ty the Ce
|___te _-pevForm _o Specific atk _Callet _\
User. 2ePined Puncher:
(— poromelery.A hont thal cove dai lt inte
2nd eee ae ae
hes devfilet -
aa MH 48 alge Henan ag Standard subeey
a Panetins ov Abuja nunca gy
SETS) ‘They Ore Ay piccally finlhiviad n
Shitg hs ede
gd
S}rcmp'
bepye)cpr C/o)»
raint)
‘int nw
eprint CL 2 "um!
sedan 0!
a —s
-| ent #198 bball | Pane:
WO > _jrtide
yoo —> Apes Na penionSe eA
omc sins the parameter irSide
= unchian _affeed th ae al
Cramp t= SPE shjpuied et a)
- w= kay 10!
gorind OV) J ue
‘nt hum _=l00;
Keer anen:
qerint f © “/ J" num),
scedyrh OF ——
—Dukpst ie all ln eae s
cal NO > dda PunWen «
Wo — > pfle an Pane ponythal iS recunsive Pamchin 2 full explainalen-
Bas P__Punctisn hat Calle ‘riSelf alles
Bl eee se Pony dion!
| tele = CD Gee vena etait rer
O_Apreblem Can be JSevided ante
fe b = Asrrblems that Cre Sproles
L| _‘mstenset of ihe tame apyeblem
Synter = retain pe Dom -rame (Apmametent)
if ( base- Con Litvon)
I
|
fo fea See
Il cote
3 2
| 2 he
Pome home poran eters)
IE : Es a
5
Cramp = int Pacer ad Cnt 9)
8
— a
| oe mreterh 1}
3
ee
cle “ x & Pach (x-1) +
~aae De |
| maine)
ied :
im
oOyeamming
jyichie © Lull explaimafisn- jinn,
Oy Shachie 18 Ured When we udomt be
allows _ifferent — Jiflerent Aypep of Sata type
mb a gs a
——_hame
| neler OU 46 doy 4. cyeste Outer
—___Jefined — data type that __Cor}euns
mdated maken wlveh Can |
j——Greeeted A nani pulated ay or $4 —
SD Shut keyword 18 used + define
Ghee chaye =
Syste Shwe Shadi chee $
data dy pe 2"
2 dota =+4p a
| GCrawple Struct ean
lf char name (S=)"
Bi int Sal?
| Nete- © OI we :
E z svarcis’bles of thal typ
le Ge Shut emp —dedaill
i &
[ee
b a ee aE ea |=
Dl “oeaieran
BL Chay pamel2ey:
BE ‘int yell:
Bs Float
On
L jnt maine)
=
Pruet Student setyit’
[ trepy Cavett name," Learn Coding")
V
cre lh voll = 198"
result q =43°
B print? C'iNamet “7S \n") result name )
print? Co Ret: Z d\n", result rel)»
sort PU Pas “A 28 " tres alt 5 My
| } reburn O%P Full explane
[yss—Unien is a user Sifsv'ed lala lope that
L allover jpn cho Shove Jifevent lala “Junee
[ jn the fame memory Joca den +
Wee © Unido Key oovd is ied te dabihe
Unie n=
D_Unieo _orttoester same Memory Fo each
Imam berg «
| OES arr ama aan
member of unis:
Syste = Unis Union name & =
pla = ype 1
data - type 27
-Crarople t= __Unjdn_empd _
Char heme [2°I)
wt Salt
Netei- @ One Unis
ad weil lep__of _thai_ Aye
Ss > une emp autaill :
Ee a 4 "op
~ lov a: ails" ol
aedrepy Crest: name," Len rn a
rest vel) = Los!
seosslts of =a9"
indf (Mamet 7S \ "4 vesulh name)”
ant CROW! "4 A \w", vecult Toll)”
TS hae
spvinté CO vipa t hap”, elk Aho Ne
rrelurh O/__ Cae
_lsthat i$ Maeve Ponies
2 ceeetoten dinvechine Hot defvien
ee —& Funehin= like macys thel
— Ae te i i Pera Ih
© mace 13 detned uri Ar a
pre preconto divec hve +
Syn tedePine macro name nace Valve
Cram ple '—
Hdedine PT 3-14
HedePre Square &) Ce bd)
int rain)
iy aes
ee dovble aren)
Ore = PT Squee Od,
= prin) CLE " aven)!
yeluy nO"