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) | Fri 9 Oct 2026, 11:30. Portion (LMS): lectures until recursion except slide 21 of the recursion deck, breadth; lab sheets until 5a, depth | 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.
Lab evaluations · the practice ladder
Lab evaluations (10%) run on VPL: your program reads its input silently, and its output is checked against five test cases, each worth 14%. Prompts and debug prints fail tests. The instructor has released 28 past evaluations, and the ladder is calibrated against them. Each stage climbs warm-up → input patterns → VPL level, with an optional beyond the eval rung. You choose the route; the hub suggests one.
The lab-eval ladder
How VPL marks you, the four rungs, self-marking with five tests (paste-checker or a downloadable test script), and routes for "eval this week", one week or two weeks.
The real thing · instructorReal lab evals
22 of the instructor's evaluations, quoted word for word with their five tests: if/else, loop over N inputs, and function evals. New: the instructor's two sample practice programs (Q1 · Number X and Q1 · Shifted number grid: nested loops + a void function) explained step by step. Hints and solutions are folded.
Syntax bootcamp
The skeleton from memory, formats, a decoder for 12 compiler errors, fix-its (including the prompt that fails every test), and how VPL runs your program.
Stage 1 · Lab 4Decisions and loops
Rule-priority if/else, then one loop over N inputs (counters, streaks, skipped values), at real-evaluation size.
Stage 2 · Labs 5A, 5BFunctions
The function-evaluation format (a given prototype plus a T-loop in main), and predict-the-output on scope and pass-by-value.
Arrays
Read N values into an array, then a second pass. VPL format; difficulty estimated, since no arrays evaluation has been released.
Stage 4 · Lab 7Strings
Safe input first (a number followed by a line), then counts, checks and transformations at evaluation size.
Stage 5 · Lab 8Recursion
Recursive functions in the function-evaluation format, base-case tests, and hand traces.
Stage 6 · timedMock lab evaluations
Six held-back real evaluations as three cold 45-minute mocks, plus arrays, strings and integrated mocks in the same format.
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.
Official portion (instructor's LMS post): lectures until recursion, except slide 21 of the recursion deck (conceptual and breadth coverage), and lab sheets until Lab 5a (depth coverage). Slide 21 is "Recursion on Arrays". Format: Part I multiple choice on an OMR sheet, Part II written answers. Mark your ID as the 8 digits of your BITS ID with a cross (x) in each box, on both sheets. To change an answer, fill the old box completely and cross the new one. The two-day plan is in Mid-sem prep.
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. Lab Sheet 5a is the last sheet in the mid-sem portion and is tested in depth; its solutions page is below.
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.
3 · Solutions · every Lab 5a problemLab 5a, every problem worked
Every question quoted as set: the 4 debugging exercises and 5 dry runs first (the multiple-choice and fix-the-code shapes), then the 7 practice problems from shortest to longest as paper-sized programs, then the challenge. Every program compiled and run. Flags the sheet's edge cases that print nan.
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). Lab 7 then passes strings to functions without pointers; its solutions page explains how. 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 · Lab 7 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.
Lab 7, every problem worked
First, the six tools Lab 7 adds to Lecture 9: strings passed to functions, arrays of strings, the strcspn trim, the scanf-then-fgets fix, strtok and sprintf. Then every question as set: 4 dry runs, 5 debugging exercises, 9 practice problems from shortest to longest, the Caesar-breaking challenge, the Archivist's grid and the 4 bonus problems. Every program compiled and run. Flags Dry Run 4's missing '\0'.
Lecture 10 · recursion · Lab 8 Hanly ch. 9
In the mid-sem portion at breadth level. Slide 21 (recursion on arrays) is excluded.
Recursion, from the beginning
Base case and recursive case, "trust the smaller call", the call stack drawn and stepped through (factorial, print before vs after the call), the three pitfalls with real clang messages, the Fibonacci recursion tree, mutual and tail recursion, recursion vs iteration.
2 · Notes · the revision mapRecursion, in one page
Rule cards, the in-class activity solved (mystery(5), digitSum(123) traced both ways), multiple-choice-style worked examples, an 11-row trap table, and two slide corrections (slide 17's isOdd(0) is false).
Recursion: predict the output
Eight generated families: factorial and power values, print before vs after the call, digit sums, Fibonacci-like values and call counts, isEven/isOdd, tail recursion with an accumulator, "which calls never stop?", printing binary. Every item has a winding/unwinding trace; 320 programs checked against clang, 0 mismatches.
4 · Solutions · every Lab 8 problemLab 8, every problem worked
An opening-move table first (base case, smaller version, what shrinks) for every problem. Then every question as set: the 3 solved problems with call counts, 4 dry runs with full call-stack traces, 4 debugging exercises, 8 practice problems (digit sum to minimum steps, with flood-fill, maze and Hanoi figures), the Change Maker and recursive prime factorisation. Every program compiled and run. Flags the sheet's tail-recursion and Pascal-overflow claims.
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.
Marks first: programs written on paper have taken the most marks in the past papers, and the operator traps turn up in every paper. Lab 5a is tested in depth; recursion and Lectures 1–4 only at breadth.
- Wed evening: two past-paper programs on paper, then compiled (coin change; largest of three without
&&). Two sheets of the operators drill. Then the Lab 5a debugging exercises and dry runs. - Thu block 1 (90 min): the 2024-25 Sem 1 paper as a timed mock, closed book. It has a multiple-choice part and a written part, like this year's paper. Then 30 min marking it.
- Thu block 2 (45 min): recursion, the lesson (or notes if short of time), then one or two sheets of the recursion drill.
- Thu block 3 (30 min): the Lectures 1–10 breadth checklist, especially Lectures 1–4.
- Thu evening: trap tables only, then an early night. Fri morning: one warm-up drill sheet and the OMR rules. No new topics.
In the exam: never leave a program blank (the marking schemes pay for the skeleton, declarations and I/O). If something is unclear, write your assumption and carry on. Rough work goes in the separate booklet, which is not marked. Your answers go on the Part II sheet.
Lectures 1–10, the breadth checklist
What you should be able to say or do for each lecture, linked to the page that teaches it, with 29 multiple-choice self-checks. Lectures 1–4 (computational thinking, algorithms to C, number systems, flowcharts) get the fullest treatment, with the flowchart symbols drawn. Includes the exam's OMR rules and five slide corrections.
1 · Past papers · every questionMid-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.