WEEK 4
WEEK 4
STATEMENTS &EXPRESSIONS
By
Michael Kumakech
VARIABLES
• Variables in C Programming
are a container to hold the
value of a data type.
• A variable is a memory
allocation space to a data
type.
• They help the compiler to
create memory space for the
type of Variable.
• Each variable has a unique
name.
Syntax of Variable in C
Video Link:
• https://www.youtube.com/watch?v=Es0OziaqaOY
Statements in C
• A computer program is a list of
"instructions" to be "executed"
by a computer.
• In a programming language,
these programming instructions
are called statements.
• The following statement
"instructs" the compiler to print
the text "Hello World" to the
screen:
• It is important that you end the
statement with a semicolon ;
Expression in C
• An arithmetic expression
consists of operands and
arithmetic operators.
• It performs computations on the
int, float, or double type values.
• Arithmetic operations can be
performed in a single line of
code or multiple lines combined
with arithmetic operations such
as addition, subtraction,
multiplication, and division.
Relational Expression in C
• The conditional
expression
consists of three
operands.
• It returns 1 if the
condition is true
otherwise 0.