Professional Documents
Culture Documents
TM
+ + + + + +
+ + + + +
®
TM
®
TM
}
Use of
Aligned identation
opening and
closing braces
®
TM
Source Program
Edit
Source Program
Compile
C Compiler Source Program
Syntax Yes
Errors ?
No Object Code
No Error
Correct result
Stop
®
TM
Decimal Exponent
point part
®
TM
User
Basic Derived
derived
®
TM
result [0] 12
result [1] 38
result [2] 45
result [4] 67
result [5] 92
result [6] 15
®
TM
Name of [0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
the array
®
TM
Example : 2 ∗ (a – 5)
Example : a+b
Binary
Ternary Operator Expression Operator Expression
expression
Example : y = (f < g) ? g : f
Example : b=a+9
®
TM
®
TM
is complement of
> <=
is complement of
== !=
®
TM
®
TM
®
TM
True
Exit
<
conditional expression
True Is False
i<0
x=0 x = 50
®
TM
y=g y=f
®
TM
®
TM
5 ∗ 10 /2 %3 ∗8
Graphical representation
– b ++
Graphical representation
®
TM
Right
1 2 3 4 justified
Left
1 2 3 4 justified
Overriding the
1 2 3 4
minimum field width
Padding
0 0 1 2 3 4 with zerors
®
TM
7 characters wide
3 4 5 6 • 1 2
2 decimal
places
®
TM
right
3 4 5 6 • 1 2 justified
2 decimal
places
left
3 4 5 6 • 1 2 justified
9 characters wide
3 • 4 5 6 e + 0 3
3 decimal
places
12 characters wide
3 • 4 5 6 1 2 0 e + 0 3
6 decimal
places
12 characters wide
right
3 • 4 5 6 1 e + 0 3 justified
4 decimal
places
left
3 • 4 5 6 1 e + 0 3 justified
left
– 3 • 4 5 6 1 e + 0 3 justified
®
TM
T H I S I S A T E S T S T R I N G
®
TM
T H I S I S A T E S T
T H I S I S A T E S T S T R I N G
®
TM
®
TM
a 1 2 3
a 1 2 3 4
®
TM
a – 1 2
®
TM
Conditional Unconditional
control control
1. break
Selection or Looping or
2. continue
decision making branching
3. go to
1. if
1. for
2. if else
2. while
3. if else if ladder
3. do while
4. switch
⎫
⎬
⎭
⎫
⎬
⎭
®
TM
True
Exit
®
TM
Exit
®
TM
if (expression 2)
Statement 1 ;
The compiler pairs
else
this if and else
Statement 2 ;
if (expression 1)
{
if (expression 2)
body of if
statement 1;
Compiler pairs
this if and else {
else
statement 2 ; body of else
®
TM
⎫
⎬
⎭
⎫
⎬
⎭
False
False
False
Default body
Exit
®
TM
case 1 match
Case 1
case 2 match
Case 2
default default
Exit
®
TM
®
TM
True
Body of loop
Body of loop
True Test
condition
False
Exit
⎫
⎪
⎬
⎪
⎭
®
TM
Test False
expression Exit
True
Body of loop
Update expression
®
TM
®
TM
True
Body of
loop
®
TM
True Test
expression
False
Exit
®
TM
®
TM
Preprocessor
Source program
for compilation
Source program
Translator
Object module
®
TM
If condition
is true
condition
If condition
is false
®
TM
False
test expression
of loop
True
Yes
continue?
No
Exit loop
Remaining body
of loop
Enter loop
False
test expression
of loop
True
Yes
break?
No
Exit loop
Remaining body
of loop
®
TM
46 52 65 ... 82 78
Array Subscript
name
®
TM
®
TM
First dimension
(rows)
2
0 1 2 3
Second dimension
(columns)
1
(rows)
3
2
4 1
0
0 1 2 3 First dimension
(planes)
Third dimension
(columns)
®
TM
®
TM
⎡a b⎤
⎢c d⎥⎦
⎣
⎡a b c⎤
⎢d e f ⎥
⎢ ⎥
⎢⎣g h i ⎥⎦
e f d f d e
a⋅ – b⋅ + c⋅
h i g i g h
®
TM
®
TM
38 82
22 10 42 55
22
35 42
52 68 72 89
®
TM
57 84
38 10 48 25
25
33
57 48
38 10 91 84
33
25
57 91
38 10 48 84
33
A[0] 84
A[1] 57 48 A[2]
91
38 10 48 84 A[7] 91
33
®
TM
25 10
A[1] A[2]
38 48
A[6] 38 48 57 84
A[5]
A[3] 25 A[4] 10 33 84
91
A[7] 91
25
A[0] 48
10 33
A[2]
A[1] 38 33
38 48 57 84
A[5] A[6]
A[3] 25 A[4] 10 57 84
91
A[7] 91
10
38
25 33
25 33
38 48 57 84
10 48 57 84 91
91
®
TM
®
TM
®
TM
1000 10
1004 (address)
1001 04
1002
1003
1004 50 pointer
1005
1006
Memory
®
TM
f e b \0
m a r \0
Pointer Variable
d e c \0
Address Value
Aname [12] d e c
Aname
(Aname + 1)
(Aname + 2)
∗(∗(Aname + 2) + 5)
∗ (Aname + 2) ∗ (Aname + 2) + 5
®
TM
®
TM
®
TM
Array [1] 11 12 13 14 15 16 17 18
Array [2] 12
Array [3] 25 35 45 15 20
Array [4] 32 16
10 20 30
Array [0]
Array [1] 11 12 13 14 15 16 17 18
Array [2] 12
Array [3]
25 35 45 15 20
Array [4]
32 16
®
TM
B o m b a y \0
A h m e d a b a d \0
∗ ∗
∗
®
TM
®
TM
age member 3
year member 4
®
TM
student A [0]
student A [1]
student A [2]
student A [38]
student A [39]
®
TM
®
TM
®
TM
Note : The link field of last node consists of 'NULL' which indicates end of linked list.
®
TM
Node 1_2
®
TM
Index
®
TM
First or
Head
First or
Head
®
TM
Top
40
node
30
20
10 NULL
®
TM
®
TM
↑ ↑
®
TM
a b
®
TM
®
TM
®
TM
®
TM
®
TM
− x2 x4
2! 4!
x 3 x5
+
− t i−2 × x2 3! 5!
(i − 1) × i −x3 x5
3! 5!
− t 2 × x2 − −x 2 x2 x4
+
3× 2! 3× 4! − t i−2 × x2
(i − 1) × i
− t 3 × x2 − −x 3 x2 x5
4× 3! 4×5 5!
®
TM
13 + 5 3 + 3 3 = 153
®
TM
®
TM
®
TM
bdi 2
(a + bi) ⎛ ac + bd ⎞ ⎛ bc − ad ⎞
=⎜ ⎟+⎜ ⎟⎟ i
(c + di) ⎜⎝ c 2 + d 2 ⎟⎠ ⎜⎝ c 2 + d 2 ⎠
®
TM