Professional Documents
Culture Documents
Lec 3
Lec 3
Lec 3
Computer Programming
Laboratory Session 03
Conditional Control Structures
if (condition)
statement;
e.g.
if (marks >50)
printf("You have passed the exam!");
Excersice01
if (condition)
statement1;
else
statement2;
Excersice04
>=75 A
< 25 F
Sample code for Excersice06
Best practices
Use vertical and horizontal whitespace
generously. Indentation and spacing should
reflect the block structure of the code.
A long string of conditional operators should be
split onto separate lines. For example:
if (foo>next==NULL && number < limit &&
limit <=SIZE
&& node_active(this_input)) {…
Questions??
Thank you!