04 - C Basics - Control Structures - Part 1
04 - C Basics - Control Structures - Part 1
04 - control structures
Part 1
(if, else, else if statement & switch case, /AhmedHatemS
y 3
result 8
Relational
expressions
• Single-Selection Statement:
if statements, when the condition is:
true performs an action;
false the action is skipped.
Practice:
Program to determine students who passed in a subject.
If grade is more than or equals 60 , the student passed.
• Double-Selection Statement:
if .. else statements, when the condition is:
true performs an action;
false performs another action.
• Multiple-Selection Statement:
Nested if .. else statements.
switch statements.
Conditional operator (?:)
...
if (grade >= 60)
printf(“passed\n“);
else
printf(“failed\n“);
Practice
Summation ( + )
Subtraction ( - )
Multiplication ( * )
Division ( / )
Next video