Syntactical errors
caused by deviating from grammatical rules of the language
Logical errors
caused due to faulty algorithm formulation
Compile errors
errors that occur when syntax errors are encountered while translating the program code into a form that the physical computing machine can understand
Run-Time errors
the effect of logical errors; appears during the execution of the program
User’s manual
step by step instruction on how to use the program
Internal Documentation
comments included in program regarding how program was designed and created
Technical Manual
printed details on how the program was designed and created
Algorithm
a list or sequence of steps that will solve the given problem
Flowchart
a graphical representation of a list or sequence of steps to solve the given problem
Coding
converting algorithm or flowchart to actual code in a
programming language
Encoding
process of entering the program through a computer terminal directly into computer memory
Bugs
errors in a code
Debugging
the process of removing or correcting the bugs or errors in the program
ellipse
start and end of a program
arrow
points to the next step/ activity to be done
parallelogram
input and output
rectangle
process to be done
diamond
decision/ choice of yes or no
Numeric Constants or Literals
Whole numbers (integers), Real numbers (floating-point), and Exponential representation
Rules for defining numeric constants
No comma.
No space between the unary sign and digits.
Begins and end with a digit.
Character Constants
single characters enclosed in single quotes
String Literals
series of characters enclosed in double-quotes
Identifiers
descriptive names for variables, constants, and other entities
Rules for defining identifiers
Must consist of letters, digits, and underscore.
Cannot start with a digit.
Cannot redefine standard library identifiers.
Case sensitive.
Variables and Data Types
store values that can change during program execution
Constants
entities with fixed values and is defined using preprocessor directive #define
Keywords and Separators
reserved words with special meanings in C
Comments
non-executable text for code explanation, improving readability
Functions
group of instructions in C that performs a particular task, or as the name implies, performs a specific function
Library
a collection of different functions
Predefined functions
built-in functions in standard libraries
User-defined functions
created functions in own library
Conditional Statements
statements that check certain conditions before executing certain statements
If-statement
either logical or relational expressions; 0 for false and 1 for true
Switch statements
can only check equality relationships
Syntax of switch statements: Expression
whose value is being tested; only expressions that evaluate to a character or integer types are allowed
Syntax of switch statements: Labeli
value that the expression is checked against
Syntax of switch statements: Statementi
the statement that will be executed if the <expression> is equal to the value in the <label i>
Syntax of switch statements: Break
prevents the execution of the next statements; exits from the switch statement
Syntax of switch statements: Default
counterpart of an ‘else statement‘
What is the meaning of this operator: ==
equal to
What is the meaning of this operator: <=
less than or equal to
What is the meaning of this operator: >=
greater than or equal to
What is the meaning of this operator: !=
not equal to
What is the meaning of this operator: &&
and
What is the logical operator of this?
&&
What is the meaning of this operator: ||
or
What is the logical operator of this?
||
What is the meaning of this operator: !
not
What is the logical operator of this?
!
L8r
Valid
star*ting
Invalid
num_Values
Valid
"hello"
Valid
0.85
Valid
'\'
Invalid
+35, 480
Invalid
`a`
Invalid
.75
Valid
"'"
Valid
'/n'
Invalid
''
Invalid
'"'
Valid
-1,000,000
Invalid
4e5
Valid
1 234
Invalid
"\\"
Valid
““
Valid
5e-7
Valid
-54
Valid
10 + 23 % (17 – 4 * 2) / (24 – (7 + 15 % 2))
10
150 - (-6 + 8 * 4 – 22 % 4) – (5 – (15.2 / 2))
128.6
2 – 4 * 3 + 26 / 2
3
(3 + 4) * 2.0 / 2 + 3.0
10.0
5 + 6.6 / 2.2 * 0.5
6.5
(x – y) <= ((j – k) – 1)
i = 1, j = 2, k = 3, x = 5.5, and y = 7.7
TRUE
(k + j) != (i + 1 * 4)
i = 1, j = 2, k = 3, x = 5.5, and y = 7.7
FALSE
i && j
i = 1, j = 2, k = 3, x = 5.5, and y = 7.7
TRUE
i == j && i + j == k || y == x + 2
i = 1, j = 2, k = 3, x = 5.5, and y = 7.7
FALSE
–i <= j – k && !j
i = 1, j = 2, k = 3, x = 5.5, and y = 7.7
FALSE
number of students
int
GPE (grade point equivalent)
float
sex (M for male and F for female)
char
discounted price
float/ double
value of PI (with 200 decimal places)
double
tab character
‘\t‘
newline character
‘\n‘
character 8
‘8‘
real number value of 1/2
0.5
integer twenty thousand and three
20003
string Taft Avenue
“Taft Avenue“
real number 8
8.0
null string or empty string
““
'/n'
not a valid literal
“8“
string
\a
alert
\\
backslash
\’
single quotation mark
\”
double quotation mark
\t
tab