CS U111 · Computational Thinking and Programming · BITS Pilani, Hyderabad Campus
The Programming Course Guide
Hanly & Koffman, Problem Solving and Program Design in C (8th ed.) + Beecher, Computational Thinking · 42 lectures, C in the lab · Module pages follow the lectures; mid-sem prep is live.
First, the honest gap check
This course assumes no prior programming — the handout says so in its scope ("programming as a means of expressing solutions", starting from flowcharts and pseudocode). Row by row:
| Course block | Assumed background? | So the gap is… |
|---|---|---|
| Computational thinking, flowcharts, pseudocode · lectures 1–3 | None | None. Taught from scratch to the whole hall. |
| C basics: variables, I/O, expressions, if/loops · lectures 4–14 | None; some classmates did 11th/12th CS (Python or C++) | Bounded and short-lived — the syntax of C is a few weeks' exposure, and the course paces for zero. Prior-Python classmates re-learn as much as they reuse. |
| Functions, arrays, strings, recursion · lectures 15–26 | None | This is where everyone finds it hard for the first time. Head starts from school CS mostly run out here. |
| Structures, files, pointers, dynamic memory, linked lists · lectures 27–36 | None | New to everyone, including students who did school C++. Pointers are the course's real hill. |
| Testing, design, AI-assisted programming · lectures 37–42 | None | New to everyone; rewards habits, not background. |
The only background that matters in this course is hours at the keyboard, and those start for everyone in week 1. Nothing here depends on JEE-style preparation. What separates marks is a habit: write small, compile often, test with deliberately nasty inputs. The setup guide below gets the machine out of the way so that habit can start immediately.
The evaluation calendar
| Component | When | Weight | Book policy |
|---|---|---|---|
| Continuous laboratory evaluations — best k of n, no makeup, must be physically present | unannounced, during lab sessions, all semester | 10% | Open |
| Mid-semester exam (90 min) | per the Institute academic calendar (handout names no date; last year's was 9 Oct) | 30% | Closed |
| End-semester laboratory exam | TBA (so the handout says) | 25% | Open |
| Comprehensive exam (180 min) | per the Institute academic calendar (handout names no date) | 35% | Closed |
Three consequences, straight from that table:
- 35% of the grade is written at a keyboard (lab evaluations + lab exam). Being fast and calm in the lab environment is a skill in its own right — which is why the setup guide below insists on using the same compile-run loop at home as in the lab, in a terminal, not only through an IDE's green button.
- Lab evaluations are surprise, no makeup, and gated on 50% attendance. Attend every lab; treat each one as a possible test. "Best k of n" means a bad day is forgivable, a missed day isn't recoverable.
- 65% is closed-book, on paper. Writing C without a compiler to catch typos is a separate skill from writing it with one — from mid-October, practise tracing and writing short programs by hand.
1) Don't learn C from a Turbo-C-era Indian textbook or from YouTube tutorials that use conio.h, clrscr(), getch(), void main(). Those don't compile on a Mac or on a modern Linux lab machine, and the course textbook (Hanly & Koffman) uses standard C. If a tutorial's first program isn't int main(void) with return 0;, close it. 2) Don't let an AI write the lab programs. The handout examines your ability to verify AI output (lectures 40–41) — use it to explain compiler errors or to quiz you, and type every program yourself.
The study pages
Each block of lectures will get a lesson (first-time teaching, slow) and notes (the compressed revision map), built as the lectures advance and lab sheets arrive.
Three past mid-sem papers are decoded in Mid-sem prep below. Their lesson: every paper tests the operator and switch mechanics in the new first module below, and program writing grew from 10 to 80 of 90 marks across the three papers.
Before the modules · get the machine out of the way
Operators, I/O & selection Hanly ch. 2, 4
Blocks B–C of the syllabus, lectures 4–9 (Labs 1–3). The labs felt comfortable, but the past mid-sems turn exactly these mechanics into trick questions: short-circuit, ++, the comma operator, switch fall-through, scanf formats. The rules are small, and the traps are the same every year.
Operators, I/O & selection, from the beginning
Values vs side effects, integer division and casts, 1/0 truth and precedence, short-circuit (with a stepper that shows which parts get skipped), & vs &&, ++/--, the comma operator, characters as numbers, nested if, ?:, switch fall-through, scanf as a pattern, and the three rewrite templates.
Operators, I/O & selection, in one page
Fifteen rule cards, the rewrite templates, three past-paper questions worked (including one the answer key gets wrong), a 13-row trap table, the prerequisite kit, and practice mapped to Hanly and the past-paper questions.
3 · Drill · predict the outputOperators & I/O: predict the output
Ten families (short-circuit, ++, comma, integer division, ?:, switch, scanf, & vs &&, chars, printf widths), six fresh items per sheet, trace on every answer. 460 generated programs checked against clang, 0 mismatches.
Number systems drill
Six methods on one screen (repeated division, fractions by repeated multiplication, place values, grouping bits from the point, 8-bit 2's complement, unknown bases), each worked on a past-paper example, then self-marking sheets with the actual working behind every answer.
Lab 4 · loops and iterative problem solving Hanly ch. 5
Block D of the syllabus, lectures 10–14. Lab evaluations are open book — the notes page is built to be the page you keep open during one.
Loops, from the beginning
Why repetition needs a new construct, the three parts of every loop, while / do-while / for built one at a time, a step-through of exactly when a for loop runs each part, nested loops as a grid, break vs continue, the three bug families, and the routine for attacking an unseen problem.
Loops, in one page
The ten patterns that cover the whole lab sheet (digit extraction, accumulators, flags, running pairs, shrinking ranges, nested grids), the trap table of standard mark-losers, two worked examples at evaluation level, the prerequisite kit, and a ranked practice table.
2½ · Ladder · before the sheetLoops, one rung at a time
Fourteen small programs in five rungs — fixed count, accumulate, digits, condition-controlled, nested — each one idea with the exact output to check against and a folded solution. The rung the sheet skips. Type them; twenty minutes a day.
2¾ · Drill · predict the outputPredict the output
Six freshly generated loops per sheet across six families (start/stop/step, break/continue, accumulate, nested, digit loops, while vs do-while); type what each prints, reveal the real output, the trace and the rule. Outputs verified against compiled C.
3 · Solutions · every sheet problemLab 4, every problem worked
All seven practice problems, five debugging exercises, four dry runs and the calendar challenge — each with the thinking, a trace, and the output it really printed. Every program compiled and run before publishing. Opens with a 45-minute triage path for a short evening.
Lab 5 · functions Hanly ch. 3, 6
Lecture 7 (Lab Sheets 5A & 5B). The class reached functions in lecture 7, much earlier than the handout's lectures 15–17. These pages are built from the lecture deck; a solutions page follows when the sheets arrive.
Functions, from the beginning
The black box, the parts of a function, what happens when you call one (step through it), return vs print, prototypes, void, pass-by-value, scope and shadowing, and why globals are a last resort.
Functions, in one page
Every idea from Lecture 7 on one page, the in-class temperature converter fully worked, a globals-and-shadowing trace, the trap table with the real clang error messages, the prerequisite kit, and a practice table.
Lab 6 · arrays Hanly ch. 7
Lecture 8. The whole arrays block (traversal, search, sort, matrices) in one lecture. Strings followed in Lecture 9 (below); passing arrays and strings to functions comes after pointers. A solutions page follows when Lab Sheet 6 arrives.
Arrays, from the beginning
Boxes in a row and why indexing starts at 0, the traversal pattern, sum/min/search, binary search, bubble vs selection sort (with a step-through widget), 2D arrays and matrices.
2 · Notes · the revision mapArrays, in one page
The patterns, the in-class Class Statistics activity fully worked, a binary search trace including not-found, matrix add/transpose, the trap table (i <= size, sizeof inside a function, …), prerequisite kit and practice table.
Lecture 9 · strings Hanly ch. 8
A string is a char array with one extra rule: it ends in '\0'. The past papers already ask char-array questions, so if this lecture comes before the mid-sem, expect it there. Four slide statements are corrected on the notes page.
Strings, from the beginning
The '\0' rule in a memory strip, and an input widget: type a line and see exactly what %s, %[^\n] and fgets store, including the leftover newline and overflow. Then strlen vs sizeof, why == fails, the string.h and ctype.h tools, and character loops.
Strings, in one page
Rule cards, the palindrome in-class activity solved, a word count traced, a strcpy/strcat predict-the-output, the four slide corrections (zero-filled tail, <= strlen, safe scanf widths, strcmp's sign), a 14-row trap table and practice.
Drills · functions, arrays and strings
Arrays, one rung at a time
Small programs in rungs, from printing one element to sorting and 2D grids, some with a small function of your own. Each has its exact output to check and a folded solution. Every program compiled.
Drill · predict the outputFunctions, arrays & strings: predict the output
Freshly generated snippets: pass-by-value, return vs print, shadowed globals, early return, traversal, search, sort passes, 2D, and now eight strings families (strlen vs sizeof, '\0' in the middle, strcmp, strcpy/strcat, off-by-one, scanf). Type the output, then reveal the trace and the rule. 620 generated programs checked against clang.
Mid-sem prep · past papers and program writing
Built from three CS F111 papers (the predecessor course): 1st sem 2024-25, 1st sem 2025-26 (9 Oct 2025) and 2nd sem 2025-26. CS U111 is a redesign, so treat the format as likely rather than certain. The C mechanics carry over.
The MATH mid-sems on 5 and 7 Oct come first, so keep CS small until then (a daily 20–30 minutes) and give it full days after 7 Oct.
- Operators notes + operators drill: one sheet a day. These traps turn up in every paper, and each rule is small.
- Number systems: 10 minutes a day for a week. It's purely mechanical, and worth up to 8 marks.
- Write-a-program lesson once, then one past-paper program a day, on paper first, then typed and compiled to check.
- Last: one past paper as a timed 90-minute mock, closed book, on paper. Mark it with the page and read every flagged key error.
In the exam: never leave a program blank (the schemes pay for the skeleton, declarations and I/O). If something is unclear, write your assumption and carry on; the papers explicitly allow it. On the multiple-choice section, check the penalty before guessing (past-papers page, start-here box).
Mid-sem past papers, decoded
All three papers quoted as set, with a traced answer to every question. The answer-key errors are flagged: two wrong outputs, a buggy quadratic, and two model answers that don't compile or are incomplete. Also: a topic map, the program-writing trend, and the negative-marking arithmetic for the multiple-choice sections.
2 · Lesson · how to startWriting a program on paper
A five-move opening routine that earns the skeleton marks even when the core logic is shaky (up to 30 of 80 marks in 2026), eight patterns and their signal words, and the paper-coding mistakes a compiler would have caught.
3 · Practice · the past-paper programsPast-paper programs, built step by step
The past-paper programs (the 2026 ones use about 80 of 90 marks): insert with shift, largest of three, coin change, cricket stats, quadratic via switch, digit-array +1, smallest permutation, character streams. Routine applied, rubric-mapped skeleton, compiled solution, mark-losers. Most double as lab-exam practice.
Syllabus map · what's coming
| Block | Lectures | Topics | Reading |
|---|---|---|---|
| A · Computational thinking | 1–3 | decomposition, abstraction, flowcharts, pseudocode, dry runs, test cases | Beecher ch. 1–3, 5–6; Hanly ch. 1 |
| B · Data & first programs | 4–6 | bits/bytes, binary/hex; C program structure, variables, I/O, expressions, type conversion | Hanly ch. 2 |
| C · Selection | 7–9 | if / if-else / switch, Boolean logic, boundary cases, debugging | Hanly ch. 4 |
| D · Iteration | 10–14 | while / for / do-while, nested loops, sentinels, tracing, invariants | Hanly ch. 5 |
| E · Functions | 15–17 | top-down design, parameters, scope, libraries | Hanly ch. 6 |
| F · Arrays & strings | 18–23 | arrays, search, sort, matrices; strings and the string library | Hanly ch. 7–8 |
| G · Recursion | 24–26 | base/recursive cases, call stack, recursion vs iteration | Hanly ch. 9 |
| H · Structures & files | 27–30 | structs, arrays of structs; files and streams | Hanly ch. 10–11 |
| I · Pointers & dynamic memory | 31–36 | pointers, pointer arithmetic, malloc/free, linked lists, memory bugs | Hanly ch. 13 |
| J · Design & AI tools | 37–42 | testing, refactoring, prompt formulation, verifying generated code | instructor notes |
Lab sheets 1–3 (data types, expressions, selection) have no pages yet — Lab 4 was built first because it arrived late and is the one still unfamiliar. If earlier sheets are wanted as pages, they slot in above. The handout still doesn't name the lab's compiler or operating system; confirm it in a lab session and the setup guide gets adjusted to match.