Recursive Functions in C: Factorial and Fibonacci, Revisited with Recursion Trees

Recursion — a function calling itself — was already introduced with full examples in Part 2 of the Functions series. This post revisits the two examples the syllabus specifically calls out, factorial and Fibonacci, with an added visual tool that makes recursion easier to reason about: the recursion tree. This is the final post of … Read more

Functions in C for Unit III: User-Defined Functions, Inter-Function Communication, Storage Classes, and Scope Rules

The syllabus for this unit covers functions, inter-function communication, storage classes, and scope rules — and this blog already has a complete, detailed 3-part series covering exactly this ground in depth. Rather than repeat that material, this post is a short guide mapping each syllabus topic to the right part of that series, plus a … Read more

Sorting in C: Bubble Sort, Selection Sort, and Insertion Sort

Sorting arranges data into a defined order (usually ascending or descending) — and as we saw in the previous post, a sorted array unlocks fast binary search. This post covers three classic, beginner-friendly sorting algorithms: bubble sort, selection sort, and insertion sort. This is Post 2 of the Unit III series — Post 1 covered … Read more

Searching in C: Linear Search and Binary Search

Searching means finding whether a target value exists in a collection of data, and if so, where. C (and every other language) commonly teaches two fundamental searching techniques: linear search and binary search. This is Post 1 of the Unit III series, opening with searching and sorting before moving to functions and recursion. Linear Search … Read more

Character Arrays and String Handling Functions in C

C has no dedicated “string” data type. Instead, a string is simply a character array that ends with a special marker: the null character ‘\0’. This is the final post of the Unit II series — Post 4 covered two-dimensional arrays. Declaring and Initializing Strings char name[20] = “Hello”; // C automatically appends ‘\0’ after … Read more

Two-Dimensional Arrays in C: Concepts, Declaration, and Initialization

A one-dimensional array (covered in Post 3) is a single row of values. A two-dimensional array extends this into a grid — rows and columns — perfect for representing matrices, tables, and grids. This is Post 4 of the Unit II series. Declaration and Initialization int matrix[3][4]; // 3 rows, 4 columns — 12 ints … Read more

One-Dimensional Arrays in C: Concepts, Declaration, and Initialization

So far, every variable we’ve used has held exactly one value. An array lets you store multiple values of the same type under a single name, accessed by position. This is Post 3 of the Unit II series — Post 2 covered break, continue, and goto. Why Arrays? Imagine storing the marks of 50 students. … Read more

Loops in C: while, for, and do-while Statements

Loops let a program repeat a block of code without writing it out multiple times. C provides three looping constructs — while, for, and do-while — each suited to slightly different situations. This is Post 1 of the Unit II series, following Unit I’s coverage of decision making. The while Loop Checks its condition before … Read more