C_Language_Unit2
C_Language_Unit2
1. Control Structures:
A. Conditional Statements:
Example:
if (a > b) {
- if-else: Executes one block of code if a condition is true, otherwise another block.
Example:
switch (choice) {
B. Looping Statements:
Example:
printf("%d", i);
Page 1
C Language Notes
2. Functions in C:
- Syntax:
return_type function_name(parameters) {
// function body
Example:
return a + b;
3. Predefined Functions:
Page 2