C Programming Introduction
C is a general-purpose, procedural programming language developed by Dennis Ritchie in 1972 at Bell Laboratories. It follows a step-by-step approach and uses functions to perform tasks. C is known for its speed, efficiency, and closeness to hardware, making it ideal for system-level programming — operating systems, embedded systems, and compilers are all built with C. Programs in C are written using English-like statements and can run on almost any computer, making it highly portable.History of C
The lineage of C traces through several languages:- 1960 — ALGOL: First language to use a block structure.
- 1967 — BCPL: Developed by Martin Richards, derived from ALGOL.
- 1970 — B: Created by Ken Thompson using BCPL. Both BCPL and B were type-less.
- 1972 — C: Developed by Dennis Ritchie at Bell Labs using BCPL and B.
Why Learn C?
- Foundation for C++, Java, Python, and most modern languages.
- Used in OS kernels, microcontrollers, game engines, and databases.
- Teaches low-level memory management and hardware interaction.
- Fast execution with minimal abstraction overhead.
C Language Versions
| Version | Year | Key Features |
|---|---|---|
| K&R C | 1978 | First version, by Kernighan & Ritchie |
| ANSI C / C89 | 1989 | First standardized version |
| C90 | 1990 | International standard of ANSI C |
| C95 | 1995 | Added wchar_t |
| C99 | 1999 | inline, // comments, long long int |
| C11 | 2011 | Multithreading, _Atomic, safer functions |
| C17 | 2018 | Bug fixes and clarifications |
| C23 (latest) | 2024 | Better Unicode, type inference |
Structure of a C Program
| Component | Purpose |
|---|---|
#include <stdio.h> | Includes the standard input/output library |
int main() | Every C program starts executing from main() |
printf() | Prints output to the screen |
return 0 | Returns 0 to indicate successful execution |