1
This section covers the building blocks of C programming: tokens and operators, input/output, control and looping statements, user-defined and recursive functions, arrays, and string manipulation.
2
Tokens & Operators C Token Type Examples Keywords Reserved words with fixed meaning: int, if, while, return, etc.
3
Identifiers User-defined names for variables, functions, arrays Constants Fixed values: integer, floating-point, character, string constants Operators Arithmetic (+ − * / %), relational (==, <, >), logical (&&, ||, !), bitwise (&, |, ^, ~, <<, >>), assignment (=, +=), increment/decrement (++, −−) Input/Output Formatted I/O: printf() and scanf() use format specifiers (%d, %f, %c, %s) to read/write data in a specified format.
4
Unformatted I/O: getchar()/putchar() (single character), gets()/puts() (strings) — read/write data without format specifiers.
5
Control & Looping Statements Construct Use if / if-else / nested if / switch Conditional branching based on a Boolean or multi-way condition for loop Iterates a known number of times; combines initialization, condition, and increment in one statement while loop Entry-controlled loop; condition tested before each iteration (may execute zero times) do-while loop Exit-controlled loop; condition tested after each iteration (always executes at least once) break / continue break exits the nearest enclosing loop/switch; continue skips to the next iteration Functions A user-defined function is a self-contained block performing a specific task, improving modularity and code reuse; declared with a return type, name, and parameter list.
6
Recursive function: a function that calls itself, with a base case to terminate recursion and a recursive case that reduces the problem toward the base case (e.g. factorial, Fibonacci).
7
Arrays & Strings 1-D array: a linear collection of elements of the same type, accessed by a single index.
8
2-D / multi-dimensional array: arranged as a matrix (rows/columns) or higher-dimensional grid, accessed with multiple indices.
9
Strings in C are arrays of characters terminated by a null character ('\0'); manipulated using library functions (strlen, strcpy, strcat, strcmp) from <string.h>.