← C roadmap

Topic 1 of 15 · Beginner

Introduction & First Program

How C programs are compiled, linked and run.

Concept

C is a fast, compiled, low-level language used for operating systems, embedded systems and compilers. You manage memory yourself.

Building a program has four steps: preprocessing (#include, #define), compiling to assembly, assembling to object code, and linking into an executable.

Every program starts at main(). printf prints formatted output; return 0 tells the OS the program succeeded.

Code (C17)

#include <stdio.h>

int main(void) {
    printf("Hello, AICodeDost!\n");
    return 0;
}
/* gcc hello.c -o hello && ./hello */

Remember

  • Statements end with a semicolon.
  • #include copies header contents in before compilation.
  • main returns int.

Interview questions

What are the stages of compilation?

Preprocessing → compilation → assembly → linking.

Why is C called a middle-level language?

It has high-level constructs (functions, loops) and low-level access (pointers, bit operations, direct memory).

Practise C with the AI mentor

Lesson test

Take an 8-question test on “Introduction & First Program” — concepts, output prediction, bug spotting and interview questions.

Can't find a C topic you need for exams or placements? Request it and we'll add it.