Chapter 1: Introduction to C Programming

1. What exactly is C?

C is a general-purpose, procedural programming language. It was created between 1972–1973 by Dennis Ritchie at Bell Labs (USA) while he was working on developing the UNIX operating system.

Think of C as the “mother” of many modern programming languages:

  • C++ was built on top of C
  • Java, C#, Go, Rust, Python (its interpreter is written in C), JavaScript engines, etc., all have heavy influence from C

2. Why was C created? (The real story)

In the early 1970s, most operating systems were written in assembly language — very low-level, machine-specific, and extremely hard to write big programs with.

Dennis Ritchie and Ken Thompson wanted to:

  • Write the UNIX operating system in a high-level language (easier to read/write/maintain)
  • But they still needed complete control over memory and hardware (like assembly)

So they created C — a language that gives you almost the same power as assembly, but with much nicer syntax and portability.

Result? UNIX was rewritten in C in 1973 — and that changed the history of computing forever.

3. Main Features of C (Why people still love it in 2026)

Feature What it means for you
Structured programming You can write clean, organized code using functions, loops, if-else, etc.
Low-level access You can directly work with memory addresses (pointers) and hardware
Very fast Almost as fast as assembly — used in games, OS, drivers, embedded systems
Portable Write once, compile anywhere (with minor changes)
Small & simple Only 32 keywords — very small language to learn
Standardized C89, C99, C11, C17, C23 — there are official standards
Huge ecosystem Millions of libraries, tools, and open-source projects

4. Where is C used today? (Real-world examples – 2026)

Domain Famous Examples using C / C-based code
Operating Systems Linux kernel, Windows kernel parts, macOS kernel (XNU), Android kernel
Embedded Systems Microcontrollers (Arduino, STM32, ESP32), car ECUs, washing machines, IoT
Game Engines Unreal Engine, Unity (core parts), Godot (parts)
Databases MySQL, PostgreSQL, SQLite
Compilers & Interpreters GCC (GNU Compiler Collection), Clang, Python interpreter, Ruby, PHP
Browsers Chrome (V8 engine), Firefox (SpiderMonkey)
Graphics & Multimedia OpenGL, Vulkan, FFmpeg, GStreamer
High-performance apps Redis, Nginx, Apache web server
Competitive Programming Almost every top coder uses C/C++ for speed

Fun fact: Even today, 90%+ of the world’s supercomputers run Linux — which is written mostly in C.

5. Different Versions of C (Quick Timeline)

Year Standard Nickname Important New Features
1972 K&R C Original version (book by Kernighan & Ritchie)
1989 ANSI C C89 / C90 First official standard
1999 C99 Variable-length arrays, inline functions, bool type
2011 C11 Multithreading support, anonymous structs/unions
2018 C17 Mostly bug fixes
2024 C23 nullptr, constexpr, typeof, better enums, attributes

Most common today (2026): C11 and C17 are widely supported. Many people still write C99-style code because it’s very stable.

6. How a C Program Works (Big Picture)

  1. You write code in a .c file → hello.c
  2. Preprocessor runs first (#include, #define…)
  3. Compiler turns C code into assembly code
  4. Assembler turns assembly into machine code (object file .o)
  5. Linker combines your object file + libraries → final executable (hello.exe or ./hello)
  6. You run the executable

7. Your Very First Program – Hello World (with detailed explanation)

C

How to save, compile, and run (on Windows, Linux, macOS):

Method 1 – Using Terminal / Command Prompt

Bash

Method 2 – Using an IDE (recommended for beginners)

  • VS Code + Code Runner extension
  • Code::Blocks
  • Dev-C++
  • CLion (paid, but student license free)

8. Common First Mistakes Beginners Make

  1. Forgetting semicolon ; at the end of statements
  2. Forgetting #include <stdio.h>
  3. Writing main() instead of int main()
  4. Forgetting return 0;
  5. Writing Print instead of printf (case-sensitive!)

9. One More Simple Example – Printing Your Name

C

10. Homework for Today

  1. Install a compiler / IDE (I recommend VS Code + MinGW on Windows or gcc on Linux/macOS)
  2. Write the Hello World program
  3. Change the message to something personal (your name, city, dream, etc.)
  4. Compile and run it
  5. Try to intentionally make 2–3 mistakes (forget ; , wrong spelling, etc.) and see what error messages you get — this is the best way to learn!

Tomorrow we will go to Chapter 2: Variables, Data Types & Constants — the real foundation of programming!

Any questions about this chapter? Want me to explain any part again? Or shall we move to Chapter 2 right now? 😊

You may also like...