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 blockAssumed background?So the gap is…
Computational thinking, flowcharts, pseudocode · lectures 1–3NoneNone. Taught from scratch to the whole hall.
C basics: variables, I/O, expressions, if/loops · lectures 4–14None; 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–26NoneThis 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–36NoneNew to everyone, including students who did school C++. Pointers are the course's real hill.
Testing, design, AI-assisted programming · lectures 37–42NoneNew to everyone; rewards habits, not background.
The honest summary

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

ComponentWhenWeightBook policy
Continuous laboratory evaluations — best k of n, no makeup, must be physically presentunannounced, during lab sessions, all semester10%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 examTBA (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:

Two things not to do

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.

Mid-sem coming up

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

0 · Setup guide · do this once

Setting up a MacBook Air for C

Install the compiler (15 minutes, no downloads from random sites), pick an editor, write and run the first program from the terminal, learn the compile-run loop, and know the four ways a Mac differs from the lab machines.

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.

1 · Lesson · first time through

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.

2 · Notes · the revision map

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 output

Operators & 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.

⏱ Drill · 10 min a day, one week

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.

1 · Lesson · first time through

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.

2 · Notes · the revision map

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 sheet

Loops, 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 output

Predict 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 problem

Lab 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.

1 · Lesson · first time through

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.

2 · Notes · the revision map

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.

1 · Lesson · first time through

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 map

Arrays, 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.

1 · Lesson · first time through

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.

2 · Notes · the revision map

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

Ladder · one idea per program

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 output

Functions, 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.

How to use these, in order

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.

  1. Operators notes + operators drill: one sheet a day. These traps turn up in every paper, and each rule is small.
  2. Number systems: 10 minutes a day for a week. It's purely mechanical, and worth up to 8 marks.
  3. Write-a-program lesson once, then one past-paper program a day, on paper first, then typed and compiled to check.
  4. 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).

1 · Past papers · every question

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 start

Writing 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 programs

Past-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

BlockLecturesTopicsReading
A · Computational thinking1–3decomposition, abstraction, flowcharts, pseudocode, dry runs, test casesBeecher ch. 1–3, 5–6; Hanly ch. 1
B · Data & first programs4–6bits/bytes, binary/hex; C program structure, variables, I/O, expressions, type conversionHanly ch. 2
C · Selection7–9if / if-else / switch, Boolean logic, boundary cases, debuggingHanly ch. 4
D · Iteration10–14while / for / do-while, nested loops, sentinels, tracing, invariantsHanly ch. 5
E · Functions15–17top-down design, parameters, scope, librariesHanly ch. 6
F · Arrays & strings18–23arrays, search, sort, matrices; strings and the string libraryHanly ch. 7–8
G · Recursion24–26base/recursive cases, call stack, recursion vs iterationHanly ch. 9
H · Structures & files27–30structs, arrays of structs; files and streamsHanly ch. 10–11
I · Pointers & dynamic memory31–36pointers, pointer arithmetic, malloc/free, linked lists, memory bugsHanly ch. 13
J · Design & AI tools37–42testing, refactoring, prompt formulation, verifying generated codeinstructor 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.