Learn the concept. Write the program. Trace the output. Build the logic.
This repository is a practical C programming learning workspace. It contains C source-code exercises in the repository itself and a separate documentation collection for understanding the concepts behind those programs.
The notes are written for beginners and use a consistent learning pattern:
- Concept — what the topic means and why it is used.
- Syntax — the common C syntax.
- Example — a small, readable program.
- Output — what the program prints.
- Trace — how important values change step by step.
- Common mistakes — errors beginners often make.
- Practice — exercises to check understanding.
The documentation ZIP accompanying this README contains Markdown notes only. It intentionally does not include or replace the existing
.csource files or executable files in the repository.
| Step | Topic | Notes |
|---|---|---|
| 01 | C overview and program structure | 01 — Getting Started |
| 02 | Variables, constants and data types | 02 — Variables and Data Types |
| 03 | Input, output and format specifiers | 03 — Input and Output |
| 04 | Operators and expressions | 04 — Operators |
| 05 | Type conversion and casting | 05 — Type Conversion |
| 06 | Conditions and decision making | 06 — Conditions |
| 07 | switch statement |
07 — Switch |
| 08 | Loops: for, while, do while |
08 — Loops |
| 09 | Nested loops and pattern logic | 09 — Nested Loops |
| 10 | Functions and parameter passing | 10 — Functions |
| 11 | Recursion | 11 — Recursion |
| 12 | Arrays | 12 — Arrays |
| 13 | Strings and string library | 13 — Strings |
| 14 | Pointers | 14 — Pointers |
| 15 | Structures and unions | 15 — Structures and Unions |
| 16 | File handling | 16 — File Handling |
| 17 | Problem solving and debugging | 17 — Problem Solving |
- C interview questions with answers, code and output traces
- Practice problems by topic
- Output tracing worksheet
- Glossary of C terms
flowchart TD
A[Program structure] --> B[Variables and I/O]
B --> C[Operators and type conversion]
C --> D[Conditions]
D --> E[Loops]
E --> F[Functions]
F --> G[Recursion]
G --> H[Arrays and strings]
H --> I[Pointers]
I --> J[Structures and unions]
J --> K[File handling]
K --> L[Practice and interview preparation]
Install a C compiler such as GCC. Check that it is available:
gcc --versionCompile a file:
gcc filename.c -o programRun on Windows Command Prompt:
.\program.exeRun on Linux or macOS:
./programFor warnings and useful diagnostics, prefer:
gcc -std=c11 -Wall -Wextra -Wpedantic filename.c -o program- Read one topic at a time; do not try to memorize everything at once.
- Type each example yourself instead of only copying it.
- Predict the output before running the program.
- Trace variables in a table when loops or recursion are involved.
- Change input values and test boundary cases.
- Compile with warnings enabled and fix warnings.
- Complete the practice questions before moving to the next topic.
- Examples are educational and should be tested with a C11-compatible compiler.
- Some operations, such as out-of-bounds array access, use of uninitialized variables, invalid pointer dereferencing, and signed integer overflow, can cause undefined behavior. Do not treat their output as predictable.
- The examples use small inputs to make the logic easy to follow. Real programs should validate user input and handle errors.
- “All possible interview questions” is not a finite set. The interview guide is a broad, curated preparation set and should be expanded through practice and project experience.
These notes are an independently written beginner-friendly study companion. The following learning resources are acknowledged as references used for learning and topic guidance:
- Apna College — C Programming video: Watch the YouTube video
- Apna College — shared study notes: Open the Google Drive notes folder
All credit for the original video and shared notes belongs to their respective creators/owners. This repository is not affiliated with or endorsed by Apna College. The explanations and examples in this documentation are rewritten for this repository; the linked resources remain the original materials.
DevPutta · Vibe Coder
- GitHub: @Devputta
- Repository: Cprogramming
Understand the logic, not just the syntax.