TRT
Sign in

Foundations · Module 1

Programming Basics

Learn decisions with if/else, repetition with loops, reusable code with functions, collections with arrays, text with strings, and your first pointers.

Start the moduleFree7 lessons · about 110 minutes

Before you can understand how C works under the hood, you first need to know how to write programs in C. This module is the gentle on-ramp: no memory layouts, no compiler internals, no two's complement math. Just you, the keyboard, and the CPU executing your instructions one step at a time.

You will learn how to make decisions (if/else), repeat work (for/while loops), reuse code (functions), store collections (arrays), handle text (strings), and point at memory (your first pointer). Every lesson has a trace that shows exactly what the CPU does, so you can watch your code run instead of guessing.

  1. 1Making Decisions: if, else if, and elseLearn how to branch program flow with if, else if, and else, use comparison and logical operators, and trace conditional execution step by step.15 min
  2. 2Repeating Yourself: for and while LoopsLearn how to repeat code with for and while loops, trace loop execution step by step, and avoid off-by-one errors and infinite loops.15 min
  3. 3Reusing Code: Functions and ParametersLearn how to define functions, call them with arguments, return values, and avoid repeating code by organizing programs into reusable pieces.15 min
  4. 4Lists of Data: ArraysLearn how to store multiple values of the same type in an array, access elements by index, and loop through arrays safely.15 min
  5. 5Text in C: Working with StringsLearn how C stores text as null-terminated character arrays, read and print strings, and avoid buffer overflows when copying text.15 min
  6. 6Your First Pointer: Addresses and DereferencingLearn what a pointer is, how to get a variable's address with &, how to declare and dereference a pointer with *, and why pointers matter in C.15 min
  7. 7Project: Interactive Number Guessing GameBuild a small terminal game that combines input, validation, loops, conditionals, and functions without hiding the learning in a library.20 min