Beruflich Dokumente
Kultur Dokumente
Imperative Declarative
Procedural Logical
e.g. C e.g. PROLOG
Block Structured
e.g. PASCAL
Start / Stop
General Processing
Decision
Input / Output
Connector
Function / Subroutine
Input radius
in cm.
Calculate area =
3.14 * (radius * radius)
Display
area
Stop
Calculate, per =
(m1+m2+m3+m4+m5) / 5
Yes
Display
per >=75 “Distinction”
No
Yes
Display
per >=60 “First Class”
No
Yes
Display “Second
per >=50 Class”
No
Yes
Display
per >=40 “Pass Class”
No
Display
“Fail”
Stop
Alphabets, Program.
Digits,
Special
Symbols.
Constants,
Variables, Instructions
And
Keywords
• Integer Constants.
e.g. 426
+756
-588 etc.
• Character Constants.
e.g. ‘E’
‘h’
‘=’
‘8’
• Real Constants.
e.g. 488.22 +3.211e-4
+85.23 5.6e4
-11.20
Operators.
• Numerial operators.
• Logical operators.
• Relational operators.
• Conditional operators.
• Bitwise operators.
+ - * / % = +=
++ -- -= *=
--------------------------------------------------------
e.g. int a, y = 10, x = 12;
float b;
a = y + 10;
b = x / 2;
a = a – b;
Relational operators.
&& || !
Conditional operators.
? :
Bitwise operators.
. # \ / : ->
sizeof (type)
Seperators:
; , () [] {}
<> “ ” ‘ ’ `
Comments
/* */
//
Types of Operators:
1. Unary
2. Binary
3. Ternary
Hierarchy of operations.
int i;
i = 5 * 6 – 8 + 9 – (43 + 2) /5 – 5;
i = 30 – 8 + 9 – 45/5 – 5;
i = 30 – 8 + 9 – 9 – 5;
i = 22 + 0 – 5;
i = 17;
Unary + - ! ~ ++
- - (type) * & sizeof Right to left
Multiplicative * / %
Left to right
Additive + -
Left to right
Shift << >>
Left to right
Relational < <= > >=
Left to right
Equality == !=
Left to right
Bitwise & ^ |
Left to right
Logical && ||
Left to right
Conditional ?:
Right to left
Assignment = += -= *= /= %=
>>= <<= &= ^= |= Right to left
Editor
Source Code
Pre-processor
Expanded
Compiler Source Code
Assembly
Assembler Language
Code
Executable
Loader
Code
Character Meaning
\n New Line
\t Tab
\b Backspace
\v Vertical Tab
\a Audible Alert
(Bell)
\r Carriage Return
\f Form feed
\\ Backslash
\’ Single Quote
\” Double Quote