Level 0 · Computer and first steps · Chapter 1/64

What programming means

Complete C PDF
Checking PDF availability…

A computer follows instructions, not guesses. In C, those instructions live in a source file and are converted into a program by a compiler. A beginner first learns to tell the compiler what to do, then to inspect the exact result produced by the program.

3 distinct programming examplesVisible outputsBeginner-friendly explanations
Educational disclaimer and third-party trademarks

Original EasyTutorGuide educational content. Product and technology names belong to their respective owners. Examples are learning demonstrations, not production-ready security implementations. Protect personal information and secrets; verify any installation commands and translated code before use. Legal · Privacy · Terms.

01 · Start with the idea and a real-world analogy

A computer follows instructions, not guesses. In C, those instructions live in a source file and are converted into a program by a compiler. A beginner first learns to tell the compiler what to do, then to inspect the exact result produced by the program.

Imagine a recipe that must be translated into precise steps for a kitchen machine. The recipe is the source code, the compiler checks and translates it, and the executable is the set of instructions the machine can follow.

C helps explain how values, memory, and control flow work at a low level. It is especially useful for systems software and embedded devices, where the programmer needs to understand exactly what data is stored and how instructions execute.

Save each example as lesson.c. Compile using gcc lesson.c -o lesson and run ./lesson on macOS/Linux (or lesson.exe on Windows).

02 · Understand these technical words
  • source file: A human-readable text file containing C instructions.
  • compiler: A tool that translates C source into a program and reports syntax problems.
  • exit status: A small number returned by a program to indicate whether it finished successfully.

Learn these words before experimenting: C helps explain how values, memory, and control flow work at a low level. It is especially useful for systems software and embedded devices, where the programmer needs to understand exactly what data is stored and how instructions execute.

03 · Three different programs with recorded outputs

Example 1: Print the first message

Locally executed output
#include <stdio.h>
int main(void) {
    puts("A C program is running.");
    return 0;
}
A C program is running.

Why that result? main is the entry point. puts writes a line, and return 0 reports a successful finish to the operating system.

Example 2: Count parts in a kit

Locally executed output
#include <stdio.h>
int main(void) {
    int motors = 2;
    int wheels = 4;
    printf("Kit pieces counted: %d\n", motors + wheels);
    return 0;
}
Kit pieces counted: 6

Why that result? The int variables store whole numbers. The plus sign calculates a new value, and %d tells printf where to display that integer.

Example 3: Choose a message with a condition

Locally executed output
#include <stdio.h>
int main(void) {
    int temperature = 27;
    if (temperature > 25) {
        puts("Cooling recommended");
    } else {
        puts("No cooling needed");
    }
    return 0;
}
Cooling recommended

Why that result? The test compares a measured temperature with a limit. Only one branch runs, which is how a program can respond to changing conditions.

04 · Pinpoint execution walkthrough

Trace the instructions from “Print the first message”. The numbered excerpt below lets you locate the statement responsible for its displayed result.

  1. Line 1#include <stdio.h>
  2. Line 2int main(void) {
  3. Line 3puts("A C program is running.");
  4. Line 4return 0;
  5. Line 5}

Trace conclusion for What programming means: main is the entry point. puts writes a line, and return 0 reports a successful finish to the operating system.

05 · Predict, debug, and practice
  1. Predict the exact visible output of “Print the first message”, then point to the statement that creates it.
  2. For “Count parts in a kit”, identify an input that changes the computation and predict the resulting message.
  3. Identify a production constraint or missing safeguard in “Choose a message with a condition”. Explain how you would test it.
  4. Forgetting the semicolon after an ordinary C statement creates a compiler error. Read the compiler message before changing unrelated lines.

Worked answer for Print the first message: main is the entry point. puts writes a line, and return 0 reports a successful finish to the operating system.

06 · Mini-project, mistakes, and next chapter

Create a battery check using an integer voltage reading. Print Low battery if it is below 12 and Ready otherwise; test both cases.

Common beginner mistake

Forgetting the semicolon after an ordinary C statement creates a compiler error. Read the compiler message before changing unrelated lines.

Continue with the folder structure, compiler, and terminal commands so that you can build each C file independently.