Python talks to computers. C practically IS the computer. Rockets, robots and game engines run on what you learn this week.
1Meet your team
⚙️
Chip the Gear: Welcome to C! I'm Chip. C is older, stricter and FASTER than Python — it's the language operating systems and robots are built with. Respect it, and it gives you superpowers.
🤖
Bittu: In Python I interpret line by line. In C, your whole program is compiled into machine code FIRST — then I run it at maximum speed. 🏎️
🦉
Professor Hoot: Don't worry about installing anything today — onlinegdb.com runs C in your browser. In class we set up GCC properly.
🐞
Bugly: And I'm still here! C gives you more power… which means MORE ways to meet me. Hehehe.
2Your first C program
⚙️
Chip: Every C program has this skeleton: #include brings in tools, main() is where execution starts, every statement ends with a ; and return 0 says "all went well".
🐞
Bugly: Forget ONE semicolon and the compiler refuses to build anything. In Python I let you run and THEN crash. C stops you at the door. 😤
3Variables — with name tags for types
In C you must announce the TYPE of every box: int for whole numbers, float for decimals, char for single letters.
🦉
Professor Hoot: printf uses placeholders: %d for int, %f for float, %c for char, %s for text. The values fill the blanks in order.
4The integer division surprise 😲
⚙️
Chip: int ÷ int = int — the decimal is THROWN AWAY. Python's / would say 3.5; C says 3. Make one number a float (7.0) to keep the decimals.
Division Machine — C style!
÷
7 / 2 = 3 (int!) · 7 % 2 = 1 · 7.0 / 2 = 3.5
5scanf — reading input
🐞
Bugly: See that & before age? Forget it and… well, you'll meet me in Week 4. It means "the ADDRESS of age" — scanf needs to know WHERE to put the answer.
6Decisions — if / else, C edition
⚙️
Chip: Same logic as Python's Day 4 — but C uses { curly braces } instead of indentation, and conditions wear (brackets).
7Quick quiz! 🧠
In C, what is 9 / 2?
💡 int ÷ int = int. The .5 is thrown away — 4. (For 4.5, write 9.0 / 2.)
What happens if you forget a semicolon in C?
💡 C checks EVERYTHING before running. No semicolon, no program. Strict but fair.
8Your mission 🚀
Mission 1: On onlinegdb.com, print your name and your dream company in two printf lines.
Mission 2: Make int marks = 87 and print "I scored 87!" using %d.
Mission 3: Delete a semicolon on purpose, read the compiler's complaint, fix it. First blood against Bugly!
Week 1 complete — you speak machine now! ⚙️
Next week: loops, functions and recursion — C picks up speed.