Why C? The Language That Built the World
C কেন শিখবেন — পৃথিবী যে ভাষায় গড়া
1. Before We Begin — What Is a Program?
A computer is a piece of sand (silicon) engineered to do math at extraordinary speed. A program is a precise sequence of instructions that tells that silicon exactly what to do. Every app you use — from YouTube to bKash to the operating system itself — is, at the bottom, a program.
Programs can be written in hundreds of languages. So why start with C? This module gives the full answer.
2. A Short History of C
In 1972, at Bell Labs, an engineer named Dennis Ritchie needed a language to rewrite the Unix operating system. Assembly was too tedious; BCPL and B were too limited. So he designed C.
Fifty years later, C is still here — running the kernel of every Linux server, every Android phone, every embedded device in your car, your microwave, and every satellite in orbit. The reason is simple: C is the smallest language that is still expressive enough to build anything.
3. Compiled vs Interpreted — What Makes C Fast?
When you write Python, a program called the interpreter reads your code line by line and executes it.
It is convenient, but slow. C works differently: you run a compiler (such as gcc)
which translates your entire program into machine code — the raw 0s and 1s the CPU speaks natively —
once. After that, running the program is simply the CPU executing its own language directly.
gcc) পুরো প্রোগ্রামটিকে একবারেই CPU-এর নিজস্ব ভাষা অর্থাৎ machine code (0 এবং 1)-এ রূপান্তরিত করে ফেলে। এরপর প্রোগ্রামটি চালানো মানে কেবল CPU সরাসরি সেই কোড execute করা — তাই C অনেক দ্রুত।
4. Your First C Program — Run It Live 🚀
Below is the complete Hello-World program in C. Click Run ▶ to compile and execute it right here in your browser. No installation required.
#include <stdio.h>
int main(void) {
printf("Hello, Bangladesh!\n");
printf("হ্যালো বাংলাদেশ!\n");
return 0;
}
| Piece | Meaning | বাংলায় |
|---|---|---|
#include <stdio.h> | Brings in the Standard I/O header so printf works. | Standard I/O header যুক্ত করে, যাতে printf ব্যবহার করা যায়। |
int main(void) | Entry point — where the program starts. | প্রোগ্রাম যেখান থেকে শুরু হয়, সেটিই main ফাংশন। |
printf(...) | Writes text to the screen. | স্ক্রিনে টেক্সট দেখানোর ফাংশন। |
\n | A newline character. | নতুন লাইনে যাওয়ার চিহ্ন। |
return 0; | Tells the OS the program ran successfully. | OS-কে জানায় যে প্রোগ্রামটি সফলভাবে শেষ হয়েছে। |
5. Where C Is Used Today (C আজ কোথায় ব্যবহৃত হয়)
Linux, Windows kernel, macOS core — সব OS-এর ভিত্তি C।
PostgreSQL, SQLite, Redis, MySQL — প্রায় সব major database।
মাইক্রোকন্ট্রোলার, রাউটার, স্মার্ট গাড়ি।
Python, Ruby, PHP-এর interpreter-ও C দিয়েই লেখা।
Unreal, Unity-র runtime-এর ভিত্তি C/C++।
NASA-র মহাকাশযান এবং SpaceX-এর telemetry সিস্টেম।
6. The Trade-offs — C Is Not a Free Lunch
✅ What C Gives You (যা পাবেন)
- Maximum speed
- Tiny executable size
- Predictable memory use
- Total control over memory layout
- Runs on almost every device
⚠️ What C Asks of You (দায়িত্ব)
- Manual memory management
- No built-in strings, lists, or maps
- Undefined behavior can bite hard
- Verbose for high-level tasks
- No automatic safety net
প্রতিটি টুলের কিছু না কিছু খরচ থাকে। C আপনাকে গতি ও সম্পূর্ণ নিয়ন্ত্রণ দেয়, বিনিময়ে memory management-এর দায়িত্ব আপনার ওপর চলে আসে।
7. Glossary (শব্দকোষ)
| Term | Meaning | বাংলায় |
|---|---|---|
| Compiler | A program that translates your source code into machine code. | এমন একটি প্রোগ্রাম যা আপনার source code-কে machine code-এ রূপান্তর করে। |
| Source code | The text you write (e.g., hello.c). | আপনি যে টেক্সট ফাইল লেখেন (যেমন hello.c)। |
| Machine code | The 0s and 1s that the CPU actually executes. | CPU সরাসরি যে 0 ও 1 execute করে। |
| Standard library | Pre-written C code — printf, malloc, strlen etc. | আগে থেকে লেখা ফাংশনের সেট, যেমন printf, malloc, strlen ইত্যাদি। |
| Portable | Code that works on many operating systems without modification. | একাধিক OS-এ পরিবর্তন ছাড়াই চলতে সক্ষম কোড। |
| Undefined Behavior | The C standard's way of saying "if you break a rule, anything may happen." | নিয়ম ভাঙলে কোনো নির্দিষ্ট আচরণ গ্যারান্টি দেওয়া হয় না — এটিই undefined behavior। |
8. Practice Problems
Every problem has a Show Answer button. The answer contains real C code that you can run right here. Try the problem yourself first, then check.
-
Write a program that prints your name on the first line and your university on the second line.এমন একটি প্রোগ্রাম লিখুন যা প্রথম লাইনে আপনার নাম এবং দ্বিতীয় লাইনে আপনার বিশ্ববিদ্যালয়ের নাম প্রিন্ট করবে।
✨ Show Answer (উত্তর দেখুন)
ans1.c#include <stdio.h> int main(void) { printf("Name: Arif Hossain\n"); printf("University: NSU\n"); return 0; } -
Print a simple greeting on three separate lines using three
printfcalls.তিনটিprintfcall ব্যবহার করে তিন লাইনে একটি greeting প্রিন্ট করুন।✨ Show Answer (উত্তর দেখুন)
ans2.c#include <stdio.h> int main(void) { printf("Hello!\n"); printf("Welcome to C Programming.\n"); printf("Let's build something great.\n"); return 0; } -
Explain in 3 sentences why operating systems are written in C and not Python.তিন বাক্যে ব্যাখ্যা করুন, operating system কেন Python-এর পরিবর্তে C-তে লেখা হয়।
✨ Show Answer (উত্তর দেখুন)
Answer: (1) An OS must control CPU registers and memory directly, which C exposes but Python hides. (2) An OS must be fast and predictable — C has no interpreter or garbage collector in the way. (3) An OS must run before Python itself can run; Python needs an OS to exist first.
(১) OS-কে সরাসরি CPU register ও memory নিয়ন্ত্রণ করতে হয়, যেটি C সুযোগ দেয় কিন্তু Python গোপন রাখে। (২) OS-কে দ্রুত এবং predictable হতে হয় — C-তে interpreter বা garbage collector থাকে না। (৩) Python চলার জন্য আগে একটি OS লাগে, কিন্তু OS নিজেই আগে চলতে হবে — তাই তাকে নিচের স্তরের একটি ভাষায় লিখতে হয়।
-
Write a program that prints the total number of seconds in one day.একটি প্রোগ্রাম লিখুন যা এক দিনে মোট সেকেন্ডের সংখ্যা প্রিন্ট করবে।
✨ Show Answer (উত্তর দেখুন)
ans4.c#include <stdio.h> int main(void) { int seconds_per_day = 24 * 60 * 60; printf("One day has %d seconds.\n", seconds_per_day); return 0; }Output:
One day has 86400 seconds. -
In one paragraph, explain who Dennis Ritchie was and why he matters.একটি অনুচ্ছেদে ব্যাখ্যা করুন — Dennis Ritchie কে ছিলেন এবং তাঁর অবদান কেন গুরুত্বপূর্ণ।
✨ Show Answer (উত্তর দেখুন)
Answer: Dennis Ritchie (1941–2011) was an American computer scientist at Bell Labs who created the C programming language in 1972 and co-created the Unix operating system. Almost every modern operating system, database, and programming language traces its ancestry back to his work. Without Ritchie, modern computing as we know it would not exist.
Dennis Ritchie (১৯৪১–২০১১) ছিলেন Bell Labs-এর একজন আমেরিকান কম্পিউটার বিজ্ঞানী, যিনি ১৯৭২ সালে C ভাষা তৈরি করেন এবং Unix operating system-এর সহ-নির্মাতা ছিলেন। আজকের প্রায় সব OS, database এবং programming language সরাসরি বা পরোক্ষভাবে তাঁর কাজ থেকে জন্মেছে। তাঁর অবদান ছাড়া আধুনিক কম্পিউটিং যেভাবে আজ আছে, সেভাবে থাকতো না।
Summary — Module 01
C is a compiled language, invented in 1972 by Dennis Ritchie, designed to be close to the hardware while still readable by humans. It sits at the foundation of modern computing — operating systems, databases, embedded devices, and even other programming languages are built with it. Learning C will teach you how computers actually work — something no other mainstream language teaches as directly.