CProgrammimg
CProgrammimg
t OG AEVIANING
D s cs Operators Loops Functions Stottch
StorageC sses scope
Pointers S i n ngs
AT s
Ee curs on
Structures Unions
Dyingrn'srule no my llocation
A A S RUE WRES
L n ed L ti
SE CH
I DU U
Tees 185 VL
I ios hing
8
I I
É
t I I I is
I i
I
thescheduf
t OG AEVIANING
D s cs Operators Loops Functions Stottch
StorageC sses scope
Pointers S i n ngs
AT s
Ee curs on
Structures Unions
Dyingrn'srule no my llocation
A A S RUE WRES
L n ed L ti
SE CH
I DU U
Tees 185 VL
I ios hing
8
I I
É
t I I I is
I i
I
I 12107123
Basics of C
Programming
two or more we
Associatuity Ja
having same
repeatersthen
penitence the
expression will her evaluated
my
using associatively
both are some precedence the follow
Iftho having
associativity
Expression Result
512 2
5
012 2 S
5.012.0 2 S
215 O
2 0.4
015
2 0 S O 0.4
Relational and
Logicaloperators K p stint
All relational
1
0 or
the
I
and
logical operatorsoutcome
If the enpecision is true then it returns I and
the emperorrien is false then it acetone o
Jg
2 All non zone is considered as true and zero
o is considered as
false
True Falk
1 OO
10 O
10 10
6S NULL
3.5
OG
1 9 574
Ey
18
a
Egs ia
883
3 9 57473
Ey
5 2 2 2.0
5.0 2 2 2.5
5 0 2.0 2 2.5
2 5 0
205 0 0.4
Modulus operative a
15
1 101 7 1
1 s 7 is 2
2 151 7
3 157 7 I É
4 1St 7 I 771572
g is s t 7 error
6 IS St 7 error g 751512
I E
modally does not work een
float values
7 IS 7
71 7 is
8 71 IS 7
e Is 0 2 21 7
g
7 5 2 7.7
15.017
Fermat specified
to d int
i f float
i C when
is string
f a addicts
e inta 2 3 4 2.0 S 8 5
g
print t d a i
2 3 4 2.0 S 8S
I 0 T t 1 2.4
output 2
e
g
0 p
Raj 8
OP
Hellos
Ey
dehnidladesEaryt
G Writt A program on
to read
the
two people integers
and
print them screen
Input Sn
O
O 1
515 O
10,20 2
Scarf
Walt returns integer i e no
Scanty alwaysinput
af proper given according
to specifics
format
Ternary operator
a 0
YE
GD 574 30 837 40
a 203
23
I
9 30
9 20
WAP to find mammon of 3 no's using
ternary operator
int a b c man
men
a b as a c a b c b c
W
write the above two without
using As and programs
operator
nd a b a Cl a c b c
cl.b
assist it
d bLc2 bad bid cad cid
[Link] ack.a
GATE wmin mination nintega variably
N A2 makes variable get a the value 4
in y the expression
following
a n u N 2 2 z
y 2
y ya
a if
614 3 2 5
y
raid main
unsigned int n o
int y
IT 10 20
asunsigned
print td
y
of
Nate value is compared with the unsigned
Ja any then it'll ignore the
variable sign
b tta b att D a b a
a b a b a b a b
11 11 17 10 4 4 9 10
9 10 9 10 a so
ayy att
Pty
ta Ptetal Pflatt
to
op 11 0 p 11
Otp op
att
GATE 2017
11 12
M 10
N IX 10
M X 10 0
L 2 13 07 23
Note 1 Program should work based
not based on compiler
on logic
same variable two times
preementing
in a single line is considered as
bad programming
a 2
int a s
Eg Pt att an at
badprogram
Eg int a s
my [Link]
Eg
re
was
easier
5
a s a s a s
Catti tittal at Il
PV 5 P V 6 P V 6
a 0 6 a V 6 a V 5
hoops
D For
2 While
do while
pruitt c t'd is
raid main I
inti
fees i l i 2 10 pointy Td itt
white loop
raid mainel
int i l
while i 2 101
I print t d i
itt
3
y
du white loop
void main
int i
L i
do
I print t d i
itt
3 while is 10
Ey
op
5 7
64 7
7 C 7
8 2 7 F
I
9
i Y414,4is
11 1 21 321
11 22 2 4222
return n
go will executeexactly
once and return value
It will execute minimum
does not has once return value has
impact any impact
It will execute min zero
tunes return value has No
impact
no
input input n 6
input 7
0 Pt
opps opt
I 6 1 I 12dots
12 6 5 12 2 1 3 10date
123 65 4 123 321 4 8date
1234 65 4 3 1234 4321 6date
1234 S 6 5 43 2 12345 57321 4date
123456 654 3 2 1 123456 654521 2dats
123456 677654321 odat
Eg
102
4012
9
11,20121126
X 4813614
91
i j R
É
Jimi TO times
3
I
s
Short circuit Evaluation
G a b c I d I evaluated
got
a b t t I 11 C tt 1 A A dtt 1
[Link] tue of a b c d
O 212 I
gl
i i m
j R
0 0 0 2 1
o o 0,211 O O I 3 1
O O I 3,1
1 1 1,3 I 1
p I I 3
Functions
the function is well
The
purpose of
ore utilization
The purpose of the loop is code repetition
the purpose of header file is function
mutilization
we want to the function then we
If need to create
reuse
header file of that particular
ferretion and include that the in required
program
Function have the following parameter
1 Declaration
Prototype
2 Function
calling
3 Function definition
contains
a Name of An
return
b type of An
e no of arguments in an
d type of arguments in an
Eg a
declaration
Actual
parameters
formalparameters
and they are called
weed variables in
the weld function
Éi a
i
Recursion
is called recursion
1 Function
calling itself
2 Reunion should have termination
my
condition otherwise it leads to stalk over
flow
3 Rewrecien internally makes use of stalk
4 time when the recursive call it
Every
made then activation record will die
created in the stack
Activation Record
I The stealth frame allocated to the morrive
fir call is called activation Record
The creation and deletion
2
records actual of activation
called
depends on function calling
sequence
Bitwise operators
operator meaning
A BitwiseAND
I Bitwise or
Right shift
a Left shift
Eg 4 25 000 1 1 00 1
0000 1I 0 0
D 12
A Ab 0000 1000 8
a b ooo 0 I at
Right shift as
Right shifta operates shift all the bits towards
right by certain number of specified bitt
Left shift as
212
19000000010 o
Of tim
L 3 14 07 23
love segment
memory
code segment
the code of all the
In segment
instruction which memory
won't
general
out the execution
change
will
theayn
be stored
program
this part is called at read
generally
and protected only
Editors note pad word pad
Ey
Data
segment
In this all variables and static variables
will be statedglobal
stuck segment
M this all the recursive function calls local
variably and formal parameters will be stored
reap segment
M the heap segment of
all the
memory
allocation will be done
dynamic memory
Like memory allocation by using
a mallock
b callous
as eccalloes
N 10
Datasegment
N 30
Y 20
Stack segment
memory
t Wh segment
Auto Body BodyYama RAM Star
segment
Body Melt
Register Body FML Registers CPLgia
Static Beedy Program 0 RAM Datasegment
Auto
Keyword
syntax with data
type variable name
auto int n
Eg
1 default all the local variables are auto
By
variables auto variables are not initialized
then Ja
default contains garbage value
auto int ne 10
MEET print
att
t d as
y y
N
10 11 1011 10 11
100 200 300
11 1 1
0 p 10 10,10
Register
syntax register data type variable name
Eg register intr
1 word register is not a command but
Rey
it just a request by the compiler to
allocate the
memory in CPV register
2 the free register are available then
Ifit will be allocated in registers otherwise
they will not be allocated in the RAM
only
3 Register variables are faster us compared to
auto variables
hem will be used
in loops and they
functions
4
Byautodefault register variable behave like
variable
only
Static
syntan static variable
datatype name
static int se
Ey
1 The variable persisting the previous
destruction
state
value even though the of
sweat functional wells is called at
static variable
2 Static variable is created only once
will allocated once in
memory
data at only
segment compile time
3 it is not initialized enfant it
Ifcontains o
has local
scope but lifetime will
Itend
after completion of program
5 Static variable can a local variable nut
allocated at compile time
memory
main 7 testa
t static int ne 10
Mufti print t d as
0 p 10 11,12
t
I N 31 2 11 O
Ex
iii
same prey without static
Termination
with stack
main 1
i
message
output 33 3
stack
mainitt weep
aid main I
I wink I
I print t 3 si
3
g
p 333
of
Q
i
XP 4 O
n't
I
1 break Y coming out of the brackets
s exit 1
program not informed
j iiiiiiist
[Link]
1I i 11 5
1 2
16
10
It iÉ
i j co
Y O 0
Y I 4
z 3 31
3 6 61
4 10 10
I
2
3
23
It Is
Har
Éi
56 t 130 116
L 4 15 07 23
16 HYE 1
7 6 4
E
I Axed 21 I É
31 2 13 4 44
w 41
1 2342
2 7 2 1
2 1 2 It
Entern
No will be allocated to intern variable
memory
and they make use of memory outside of
variable global variable
X
enterninta
intern into
enumenaminting int a
pten
inta
Pten Y
int a 10 I
multiple declamien
output 5 output o variable
ofin some
the same
multipledeclaration of same variable allowed when brain notallowed
in the same function is enter only
variable is
allowed only if it is entern declared
wedon't write
the
i enterndoes not declare i.e allotment Ja
intern invite them
for the variable thatwhy it isallowed it is not allowed
7 mains
intern int a 10 A enter variable
for
Pf Cal assignment is allowed only
Mitoulization is not allowed
output error
8 int a
void main 11
intern int a
PA a i
output O
I I
DI 10
ate 20
I A
91201 301
4 a El
pseudo well p I
D I
I
Ia I
Scope
It is categorized in the 2 types
a Static scoping compile Time
D Dynamic scoping Runtime
Fuevarality
static Yuval 0 2
5 1
E Est
mainn
É
AFI datasegment
be
stack
dynamic your
man
I El
main YES
FIE
sung
I
0.25
YES
da Seger
i K
L S 16 0725 th
i.e
ÉÉj
EH
3 ever
ere ell
9 s I
4 G x O Enda
3 I
É
7,8
4 6 4,5
4,5 96
3 4
11
7,8
I
3 5
4,6
4,6 4,5
7,8 4,5
416 46
as X
4,6 X
I
Ell 3 27
6464
[Link]
Mlb
4 454 se
boss
s
1 6
y
5127 5127
44,67 2,64
54,3
2,3
g int a 10,6 20
mains 361
intb
statiginita
entemintbi
static so
ptfaitli pf aib
s
9 3,6 17 6 44
El
Pt aib
DCI EL
registerinta 11 into o
Pt
aib entermintb
Elli
b 60
pt agb
bell
Pf aib 3
I Exits
iii III
b int int
Pope
0,20 0120
11 1 60 11160
sooo
a stat 8
I
7.031,45
b stat
Painters
1 Pointe is a variable which is used to
store the address
2 The two different operators used in the
pointers
a S address of operator
de indirection operator deference operator
at
value at location
defect location
3
painter variable takes same bytes of memory
irrespective all its data type It can be
integer painter Float
water pointer
pointer
4 Pointer variable can be dereferenced carers
no of
bytes depending on its data type
5 Integer painter won
dereference 2 bytes character
painter can deference 1 byte Float pointer
can deference a light
Pointer variable declared
G can be
wring
Nate I Adders cannot
negative be
2 Address wise will differ from system to
unos
system depending
painter topics
Basics
painter to painter
Painter to
way
Multi dimentional arrays
painter to strings
painter the structures and functions
Army of painters
Baris
10 a
I int a
FI
int bi
bi
b Aai T t
say im we stand in the
pointer only
variable
to
a 10 Pt a
100 Pf Aa 100
100
Pf I b
b 100
200 Pf bl 10
pt Sb 200
4 Id
Pt a b i fleeter
It oil isjustbefore
pointer
b it is treated to
td 100
Pt
44 4
5 10
Pt A a
6 b too
pf
Pf b 10
Pt Sb 200
Pf SbI I 00
Pt AD 10
Pf b error we ten
trying double ptr
on a variable declared a
Pt eisees
single per
Ey
parameter passing techniques
1 call value
tall
by call address
2
by reference we
by
weaves is passed then the receiver
go
must be being
pointer variable
actual parameters are
In the above program because tall
getting changed of by reference
C language supports only call by value but
we can achieve call inference by paving
east by
I
M the question if the call
by reference is
given then whenever the parameter is paired
in the function we need to understand
implicitlyaddress is
being passed and receiver
is a painter variable and actual parameters
will be changed
nos
4D lorn 7
y y we 2 712
2
12 6
a 3
gb
4,4
Painter to Painter
25
100
1 is calledas singlepainter and 100
Jt
we need to store welders 200
and it can of 25
integer aunt
upto 1 level 200
2 It is called as doublepainteras 25
painter to painter and we need 100
of single
the street address 300
painter integerpainter and it 300
new wells uptle 2 levels 400
1 3 is
called as
Jt triplepainter 200
23 painter to painter to painter
in
100
and we need to store address of
double painter integer doublepainter 25
and it can access upto 3 levels It
ptv 100
200
pptr 200
300
ppp tr 300
900
[Link] 9.43
D
c 47
be
Ets
a f b y y 7
I4 5
11
a t
100 t
surf
D t
b 100
b 10 t I 0
200
Painter to
array
without contain
1
Array
week address
name
the subscript
of alley
2 This base address is constant and it can
not be modified
3 name is considered as constant
peeing
v MP
painter Arithmetic
void mains
int a 53 110,20 30,40 504
int ai
int PI att
p2
print t d p2 p2
9 10 20 30 40 SO
100 102 104 106 108
PI 100 P2 108
1 We can weld integer constant to a
painter
it meant the elements in the
skipping
direction
forward
P P I Ey at 3
Ey 100 3 2
P 100
HQ so 06
4 SO E
P 102
2 We can subtract
integer constant to the
the
pointer It means
skipping
the backward direction
elements in
Pz 2 P I
Eg Pz Eg p
108 2 207 100 1 2
P2 104 D8
met recommended
Ego S E
4 We cannot weld point number
to a
painter floating
because it has no
meaning
Eg PIS Ey PET
P1 P2 X
1 Dimensional Away
int a 53 10,203307 0,50
0 I 2 3 T
SA 10 20 30 40 SO
110
100 102 104 106 108
Sa
Ma operandishaving
sa higherpenance
I then operator
Fa int DE
Vo
pis painter to the
en
up 5 elements
way element where
is an integer
every
Expression print meaning
value
type
1 Sa 100 Bare address
into
of the entire
IDavay
g Sati a
12
subtraction
5
is
elements
the me
continuous
legal aways
i.e better the
ways are
adjacent
g Pf Sati A1 error
Tutin Lumut
army 10 100
In the element
c
language if we want to pass an
to function then it is not
ursay
a idea to pass all the elements
great
Instead by simply passing the way
base address
of way we can access all the
way elements
Ét i
i
Nate is initialized all will
ga
beaway
remainig
stored at o's if it is not initialized
then it contains value
garbage
D reeidmaine 4 raid main 11 3 reeidmaine
I infay intact L intact 410,204
print t id 9523 print t id acz print t id 9533
Pt t d 9213111120
Y o p G v y o p O
y
painters
Array of
like we have
1 just mkay of integers we can
also have
way of pointers
int as array of integers
2 int A 5
int D
PLA
D I p OF Sb
a
IIE
a b C 30 40
lo 20 d 1 name meant
100 200 300 400 may
Base Addict
2 Variable name means
inside value
200 300 100 400
10
soo sot 508 512 Pfea 500
pl
pf Perl soo
ptr 500
Pt
ooo pts pertil so 4
p
Pt per117 500 0
100
A 10 20 30 4050 Pf a
100 102 104 706 108
200
Pf Perl 102
Pf att
204
100 102 lot 106 108 Pt Pt I
p 200 204208212 218
pt part 1 209 10
pt Aa
Pt Ap 100
Ptr 200
Pt PEA a No
100 100
pf Ptr 02 0
y
WE
sold
iiiiiiiiiii i
i
is
i
2212
3 ios no I
L 7 18 07 23
P
Dj
III
party
1 I 20
1 2,30
1 2,31
1 3 80
2 1,25
2 2,36
2 2 37
1 it is
Ifelement a dimensional assay then our
element
meant base address of normal
En int as
a int type
2 Ja it is 2 D then our element means
base address of allay 0th 1 D
assay
En int a 3343
u int Cs
it is 3 D
array0th then ooh element many
3
Ja address
a
2 D
base of array
Ese int AETHES
a int JL
2 D
Assay
1
is good
A example for painter to painter
2 D way
2
Inandthe3 above enemple it represents gravy
columns
1 In the 2 D
assay asis repaints constant base
addicts af ith row o th element and it
cannot be changed
É Ja we
perform a is 200 then it
gives
because we can't constant
error
week addict modify
ith raw 0th element
of
s 2 D will be steered in the
memory
in essay
the form of multiple I D
arrays
G
Assay
name without subscript gives been
address 0th I D essay
a iJ 20 it means ith row jturalumin
7 j with
with replaced 20
physical view
sa
Sa
as a
10 20 30 40 50 60 70 80 110
100 102 104 106 108 110 112 114 116
111
Sa
or a
Cato
METED
sa V0
or a pit painter
a to a 2
Pursey
elf life 3 3 while
everyelement
integer
Expression print meaning
value
type
1 SA 100 int JL B A of entire
2D
away
2 ya 100 int C B A If 0th
a a I Daisey
Choo t il I
0th ID
1061 til
1st D
106 1
A 23 1
Eg
1
4 2
on ID
array
1121 1
2nd ID
away
C2 1
0th element of 2nd 7Daney
it
1st element I in
80
Value of 1st element it
Q Pt td Sati a
I adjunct 2D
array
Furay of adjacent Dawg
Q Pt t d Sati a
1182101 112 7
Pt td Pti
too
1 118
KID
int p 63133 D
D da A
at t3
9137133
comparison operator
compares value only
and not the type
L 8 17107123
Will 6
type into
Athists
2
2 Ab BA xx
A
31
Catz
logical view
0 100 10 20 30
100 102 104
1 106 40 50 60
106 108 110
2 112 70 80 90
112 114 116
3 D
Array will
3D be stored in the memory in the
arrayof multiple 2D arrays
form
a a
at
CH t D ti I
I 00 t y 1 I l
o th 2 D
I 24 I t 1 Il
assay
14 2D
Away
CI 24 D D
O En ID I A 2D A
C13 2 II
1 M ID 1
K ZD A
132 1
O th element 1 it
D 11 2 D A
134
1st element 1 A ID 1st211
I
N I 2 33
CEE 2 31
64 T2 I
to 3 I
461
2
1 pf id sat it a
148 100
44 2
2 Pt t d Anti a
148 100
4 6
3 t d Cd it
Pt at a
00
1482 412 24
Itereperuniens
DIED was
35
foists
4000
Won'tmake
diagram
451
Roughdiagram
only
strings
called
1 mute
endsway is
with
as
string string
NULL character
always
2 NULL character representation is 10 and Ascii
value elf 0
always gives
3 name ease address
String
4 Every character
of string stored in the
in the continuous
memory sequentially
in the
locations form of their ASCII
values
L 4 20 07 23
need value
Note I feer to s we to provide ASCII
and stereo
Reading painting
1 Yo I elevate
2 to d AS I 11 Value
3 stereos then consider AS111 value
Reading
all the respective character
explanation
1 need the size for
Explicitly
the null
we
character
to
provide
otherwise it print
some additional value
garbage
2 it calculates size and allocates
Implicitly
the
the
memory accordingly
3 The of the statement
above it
meaning
we are
requesting
the
compiler to allocate
the for the INDIA and berk
memory that
address of string
will be stored
in the pointer string
variable p It is consider
constant and contents of
us
string can't be modified
constant thing
PLZ A not allowed
5523 A allowed
in i Pf i 100
to i 102 103 lot ios
log
too AT not allowed
p pti
200
p af i assignment
Myalagnatymodity constant
S Str Pf Str 100
of p Bye
Nate we are comparing the new addresses
of 2 different strings because
they
will be
are the
different output
Bye
elldo
200
iugn
[Link]
BA of
string
3 converts all characters to
strupress
uppercase
S E stolen s
I
s
Cto
Plo SLO Ho I
gydnoop
É
GIE
pÉIEÉE
E A a
ABCD E
12345
Ptt
201
9 void mains
sing
int test char pp
men Pz P
while p ABCDEFG KIIR
1234567
return P Pa
106
It
100
L 10 21107123
NW
a
i Birmingham
pj wingman
does
and an
Birmingham
IT IF
i rape
error
p FIFI Bahubali
a mather
essay au
AL l l T
21 3
E au
GV
lessor
Est i 2
r
i
I Dal ji
o d nu a n
am
j
t
harawahi
whether we
element address or ID alloy
are
going
BA it doesn't matter as 1.5
require address of a chat
allay
WAP to Implement string copy Function
while t tt Stt
assignmentoperator
returns the resigned
value
Tape lusting
order
Invariables to perform operation between 2
then
typeof both the varieties
should be same otherwise we need to
perform typecasting
int i 2B
Eg
Miami Is
implicit type casting
technical name for
f i collision implicit typecasting
B 2B f Coati
problem in type
type
to casting
wee problem in size float
No error
compiles will do
typecasting
implicit type casting
i f
2B 413 t Coat i
type casting
to float
problem in type
problem in size
Esker
type castingrequired
user
i ant ti
type casting to int
no user after type cutting
Type casting in
painters
int a 10 300 301 307
O 0
onByte
303 300
0thByte 1stByte onByte 1stByte 1stByte
1100 000 0001 10 110 1 11 10 000
910 003000 00014010
go
LV
300 0000/Y0001 0010 110072
LV
Little Endian L V LA
Big Endian Lu na IE a
deserving by typecasting
11 22107123
L
gÉ IstBget
0 010 1100 oooo 8881
a
100 101
656
Voice Painters
1 Just like we had integer character painter
also have void painter
similarly we can
th g i [Link]
100 ng 300
P 300
Q
200300
It
will clarity now
Type casting give many
⑭ dates a
painter variable can dereference
Pointer to Function
void test
test
main Cl
h void testy
1 Will D C
23 p test PFL Hello
pic Y
Enplanation
1 function painter p is a
Declaring to thea function which doesn't take
pointer and return is void
any arguments type
2 Assigning variable
the B A of test function to
pointer P what enghtpaintertofunctionin an
3 the function painter variable
calling
P wing O
void Epl
p is apainter to
a for which returns
raid
Terminology for various expressions
1 Void P 1
P is which takes
a
pointer to a function and
returns painter
integer us an
argument
integer
4 int as
is s elements where
a of
elementassay is an integer every
5 int as a is
array of integer pointers
pointers o typ integer where we can
integer
G int a LS
u is painter to an of elements which
usury
contains integer elements
7 int a
-
A is a painter to a function which takes
no argument outruns void
-integer
and
8
- int al
a is a function which does not take
any
argument and returns
integerpainter
cheer a
a is a which takes
two pointers painter
us
to a
function
and return character
woolen argument
pointer
10 int 4153
M is an of S elements where
every
element is
painter a
which takes pointing
to a
function
and returns
no
arguments
integes
11 cheer 1 1 21 30 l
[Link]
5
all otitis 1110 Both mean
i
idi 1 10 insane
yefpte Ramesh
Ptl ptr person ↑
is ez ptr legal yes Ty
100
brainstorm
En I Enz
struct node struct node
d int data d int data
struct node 1XX
maillot struct node IV
nailImm
ref p 7 rel pt8
+ 7
ref Pt ref Pt 8
y y
En 3
void mains
strut emp
int id
float b
3
meet j
void meee
scope problem
struct amp et ez ez 11
11XX
xx scapeproblem
Note marn
1 Structure defined
iscreating inside the main but
we are structure variable anthill the
main creating
i e meet allowed
to create variable outside
2
Jathe we went
main 11 then
structure
define structure outside
main c
En 4
struct St
hit a struct 52 h 10.120 at 1053120.53
was bi g n
float in stratum
review e
Unions
1 Thesize of union will be man size of
member variable
2 Inmembers
the structure we can access all the
at time but in ear of
union we canany alert member
variable only one
and all the
remaining members
will contain van
garbage
3 shared union
the same memory space will
In
be shared all the member variables
by
t name ofunion
J
keyword
med Ymemm
variables und beer butter un
data
in
win any
type
v0 be used with it
I
Fam IImaineasy
L 12 23 07 23
Assays
1 Similar items stored
2 Contiguous
3 Random access 0 i time complexity
4 inden starts from 0
Array always
1 D
Assay
int d fo 7 ago 10,20 1003
Clavelboundlb up upperbound
0 I 2 J K S C 7 8 7
10 20 30 40 SO 60 70 80 70 100
100102 lot 106 108 110 112 114 116 918
loc
Eg
1 the caff 100 18 03
[Link]
towel bound
100 t 16
116
10575
Note I 9 lb Mb B A S O E S
hee a Ci B A t i lb s
⑭
always
2 indene start with zero
Assayit always
not with zero then
Jaone additional
is
starting
subtraction operation
is requited
2
Darnay
int a 1 Cl s
Eg
161 Ubl 162 ub2
101
Trains
columns
abt
Ub 2 162 t I
1
YI I Its
2 D will be stored in
memory
in forms of multiple ID array
217 elements will be stored in
the way
memory in the 2 different ways
major order
a Row
b column major wider
c language
by default follows econ
magics order
94 942 944
1 I 7
an 9,2 dis dat dis Aa 922 923 924 925 Az 932 933 934 935 At 942 Ats Utt 945
too 102 lot too 108 110 112 114 116 118 120 122 124 126 128 130 132 134 156138
100 IS 23 2
134
2 doe ca ga 100 I D S t I z
100 133 2
126
677 BA 7800,5 5
Af 67 318 17
doe a 36111673
A I bl n I 2.62
2756558
Coe a 691 IS D
n s db
dbz
100 18 3 2
136
2 We a 43 100 4 D 4 Z D x2
100 2 1 2
126
Question
A f 29 647 3 777 BA 3500 5 8
noclastin7 <730]) =
4021876
we a 591515773
t planes
planet
sulfates many columns
No elf v62 162 1
rat
No afcolumns V53 155 1
multiple array 2D
stored into a
3D
array
so ell -
En A 3 8 S 154 10
6
it
2D
ID array each
each
of size 11 7
away of sin 7
20 4 10
3 311 7 5
4 11 7 6
s 11 7 7
6 11 7 8
7 511 7
8 1 11 7
is
B A 100 5 2
D We a 6 8 73 I
100 6 3 11 7 8 5 s 7 4
32
t t t bath t
② lb ar n e C 163
610
We 7 1a x
G
100
147 3 x 11 7 14 5 7 X 4
42
7 7 7 S x2
100744
loot 308 68 X2
852
[Link]
doc a cis cider BA i LD n not Ci Iba net G I x
C MO
[Link]
Ubz lbzt I
N C UDz 103 1
Matlin
how
triangular
a C1 4 1 9
Il ut it tub thenseen It
911 O O O
921 922 O O
1 2 3 1
931 932 933 O
n
441 10
elements
No of non zero
4121
Note 2 T.M is possible only for square
meettin
RMO
All 92 922 931 932 033 At 942 943 944
100 102 104 106 108 110 11 114 118
1116
j
É
Me Cactus 100
É 3 1 2
lb
100 6 2 2
16
hell 91617315303
iz t
i iii
1
soot 530 25 xD
62124977
2360522
Q1 6503 350
a 350 6503 BA 4600,5 8
4600 61 7418
for Kj
int n o
3702432 we acid D
is
outorndn
Nate a Lib Ub lb Ubi i BA S O E S [Link]
itch Ci bitt
localizeD B A
2
j lb s
is
L 13 25 07 23
Matlin
how
Triangular
act all 43 aijffenzene It
Ibl up Ibi Ubl
911 O O O
921 922 O O
4 3 2 1
elements
No of non zero mind
CMO
3 27 2
Af 100 4 5
341 3 2
100 10 G I 2
100 10
II
Ub Cb Ub db uh j Ub j
C3 31 1
doe a 43 3 100 4
141 i
1
j
1 11 4
2
Ct 37 2
I 00 10 3 1 2
116
81
I
683 115
doe a 311312763
317 2463 9
7200
1577
5
81 832,8
4 233 7
1014242
Welte a lb Nb lb Uh B A S O E S C MO L.T
hee Ali i3
iz
cob albite cub bit'D Cubitt cub it til i
BA xz
2 2
Recursion
TR Cantal
a ifreturnnot
else
2 pf n
autumn TR n Di
1 N O
0 P t 4321
12 x
1 x net
I can be reproduced
with simple for
l2 white weep
1 X N 2 Me
2 int n
fell n t n o n J
th t d n
t 3 pf
2
4321
n a
112
if Cna D return
else
I A n 27
2 Pt n
3 A Cn it
a n 2 i
Pt
A 4
1 2 3 4
A 2 A 3
1 2 3 4 1 2 3 4
AI At 41 A 2
1 213,4
Aca ACY
Note 1
Disadvantage is meeting the equivalent
non recursive
program is possible but
very difficult
92 A int ni
if ne 1 return
else
1 Pt u 3
2 A Ch i
3 PtCnn 21
l
a A
s Pt n
6 A n 3
7 Pf n 2
Ace
1 2 3,4 S 6 7
I [Link]
É s bit
8 IE I
1 1 20 2 3 13 1 1 2 04 2
I 0
Indicate Recursion
The twee or more function calling each other
is called as indirect recursion
Eg B int n
ACint nl
if ne 1 return
if ne 1 return
else geese
Pten 3
B n 2 i
k pfeng 3Antis
3 B M
4 11 4 2
y
ACK
1 2 3,4
B12 B 3
1,213 1,213
I A 2 Alll
Afl Ago X
1,213,4
Bfd BY
what if the 1314
op of
it
A3 A 2
I 23 4
3
If
I
1
ALI ALI
Nested Recursion
recursive
function
A recursive function when is passing
itself as parameter to a recursive call is
called at nested relation
att if M O
A Mon A m 1D if n o
A m 1 ACM n D otherwise
Acts'T
ACO A 1,4
ACO AC1,3
A Co A IR
ACO A lil
ACO All 10 3
ACO 1 2
what is A 2,31
op of
All A 2,252
i
t
ai bags
Alo a
ACO Allis 9
4 W 1 A 3 3 61
2 A 3 2 27
Dynamic memory Allocation
1 Array follows static allocation
meant we should memory
know the acquirement
Itelf size prior to the declaration
increase the size of
2
Ifway dynamically
we want to
then its not possible
Dynamic allocation
3
By
can using
allocate the
memory whenever u
we
memory
want at runtime whatever memory
allocated Dynamic
Allocation that using
by will be in the
memory
map
segment
4 The lifetime allocated
of dynamically
memory is entire program
5 The following function we used in the
Dynamic Memory Allocation
mallee
cumuli
realloe
fries
mallee
heapsegment
350 8D [Link] latest tubac
too smaller h Old Tarlac
per 100
200
Stack segment
syntern
painter variable type cast mather sizeof size
Eg float ptr
ptv 350fluent malluefriseofffloat
Ptv 87
print ptu
Eg free Pt
Ptr NULL
heapsegment
350 8D
100
Dangling painter