Two-Dimensional Arrays in C: Declaration, Initialization and Accessing Elements
In the last post we used a 1-D array to store a single list of values, like the marks of one student. But a lot of real data is not a single list. It is a table: marks…
In the last post we used a 1-D array to store a single list of values, like the marks of one student. But a lot of real data is not a single list. It is a table: marks…
Suppose you want to store the marks of 5 students. With what you know so far, you would write five separate variables: mark1, mark2, mark3, mark4, mark5. Now imagine 500…
A normal loop is simple: check the condition, run the whole body, repeat until the condition becomes false. But real problems are not always that tidy. Sometimes you…
Look at this line of C: 2 + 3 * 4. What is the answer? If you read left to right like a sentence, you get 5 * 4 = 20. But C says 14. Why? Because C has two sets of rules…
The for loop is built for definite repetition — you know in advance exactly how many times it needs to run. But plenty of real problems don’t work that way: keep asking…
C Programming Series · Variables, Storage, and Visibility
Back in the Algorithms post, several algorithms shared the exact same shape — a counter starting at 1, a condition checking whether to keep going, and a step that moved…
The last post ended with a warning: an if-else-if ladder longer than 5–6 steps starts getting hard to read. switch is C’s answer to exactly that problem — a cleaner way…
Every decision your program will ever make comes down to one basic tool: the if statement. But if on its own has real limits — and understanding exactly where those…
Every value in C — no matter its type — is ultimately just a pattern of bits in memory, as the “Data Types in C” post explained. Most of the operators you’ve used so far…