MCS-201 · Unit 1

Programming Fundamentals

Section 6 of 9

Block 1 · Unit 1Programming Fundamentals10 min · Section 6 of 9

1.6Structured Programming and the History of C

Covers IGNOU MCS-201 §1.6, 1.6.1

Early programs jumped around freely with goto statements and became impossible to follow. Structured programming fixed this, and C was designed as a structured language. This section explains both ideas and gives an accurate history of C.

Structured programming

In the 1960s many programs used unrestricted goto (“jump to line 240”), producing tangled control flow nicknamed spaghetti code. In 1968 Edsger Dijkstra published the letter “Go To Statement Considered Harmful”, and the structured programming approach became standard.

Structured programming combines ideas from earlier sections: the three control structures (the Böhm and Jacopini theorem in the Flowcharts section) and top-down design.

AdvantagesDisadvantages
Easier to read, test and debugOccasionally slightly less efficient
Modules can be reusedSome unusual control flows are awkward to express
Teams can work on separate modules
Easier to maintain

C still includes a goto statement (Unit 3), but structured C code rarely needs it.

History of C

1960ALGOL 60, international committee
→
1963CPL, Cambridge and London
→
1967BCPL, Martin Richards
→
1969B, Ken Thompson, Bell Labs
→
1972C, Dennis Ritchie, Bell Labs
→
1978K&R book
→
1989/90ANSI C89 / ISO C90
→
1999–2024C99, C11, C17, C23
From ALGOL to modern C
  • C was developed by Dennis Ritchie at AT&T Bell Laboratories in 1972, mainly so that the UNIX operating system could be written in a high-level language. It was first implemented on a DEC PDP-11.
  • C took ideas from B (Ken Thompson), which was itself derived from BCPL (Martin Richards), a simplified form of CPL.
  • In 1978 Brian Kernighan and Dennis Ritchie published The C Programming Language. The version of C it described, called K&R C, became the de facto standard.
  • An ANSI committee (X3J11) was formed in 1983. Its standard was completed in 1989 (C89) and adopted by ISO in 1990 (C90). Later standards are C99, C11, C17 and C23.

Key takeaways

  • Structured programming uses sequence, selection and iteration, single-entry single-exit blocks, and top-down modules.
  • Dijkstra’s 1968 letter started the move away from goto-based code.
  • C: Dennis Ritchie, Bell Labs, 1972, developed from B and BCPL, to write UNIX.
  • K&R C (1978) was the first de facto standard; ANSI C89 / ISO C90 was the first official one.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

Who developed C, and where?

Show answer

Answer: C. Dennis Ritchie, AT&T Bell Laboratories

Dennis Ritchie developed C at Bell Labs in 1972. Ken Thompson created B, and Martin Richards created BCPL.

Question 2 · multiple choice

What is the correct line of descent leading to C?

Show answer

Answer: B. CPL → BCPL → B → C

BCPL simplified CPL, B was derived from BCPL, and C grew out of B. The study material suggests B came from CPL in parallel with BCPL, which is not accurate.

Question 3 · multiple choice

Which set of control structures is used in structured programming?

Show answer

Answer: D. Sequence, selection and iteration

Structured programming builds all control flow from sequence, selection and iteration. Input–process–output is a design heuristic, not a set of control structures.

Question 4 · multiple choice

In which year was the first ANSI C standard completed?

Show answer

Answer: D. 1989

The ANSI committee was formed in 1983 and finished the standard in 1989 (C89). 1978 is the year of the K&R book.

Question 5 · multiple choice

A program contains: “10: read n / 20: if n > 100 goto 50 / 30: print n / 40: goto 60 / 50: print “too big” / 60: stop”. Which structured form is equivalent?

Show answer

Answer: B. read n; if n > 100 print “too big” else print n; stop

When n > 100 the program jumps to line 50 and prints “too big”; otherwise it prints n. Swapping the two branches, or using a loop, changes the behaviour.

Question 6 · short answer

Give two reasons why structured programming is preferred to goto-based programming, and name its three control structures.

Show worked answer

First, structured code reads from top to bottom, and each block has one entry and one exit, so the flow can be followed and checked without tracing jumps; this makes debugging easier. Second, the program is divided into modules (functions), which can be tested separately, reused and shared among team members, making maintenance easier. The three control structures are sequence, selection and iteration.

↑ ↓ move↵ openTab switch type