Concepts of Structured Programming Language

Structured programming builds every program from just three shapes, sequence, selection and iteration, arranged in blocks with one way in and one way out, which is why C code can be read top to bottom.

9 min read · 9 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

Two sets of class notes

Two toppers lend you their notes before the exam.

Notebook one reads top to bottom: headings, numbered points, done.

Notebook two is a maze: "see page 12", page 12 says "continue from page 3, unless you came from page 7". Every line points somewhere else. Ten minutes in, you are lost.

Early programs were notebook two, and planes and payrolls ran on them. The cleanup that followed is called structured programming, and C was built to enforce it.

Theory

Spaghetti vs a well-bound book

Code full of arbitrary jumps was nicknamed spaghetti code: pull one strand and twenty others move, because goto statements criss-cross the program like noodles in a bowl. A structured program is the well-bound book: chapters (functions), sections (blocks), each read top to bottom, one entrance, one exit. You can open chapter 5 and understand it without unrolling the whole bowl.

Theory

The three shapes, formally

Structured programming's claim, proven mathematically in 1966: any program logic can be built from three structures:

  • Sequence: statements one after another, in order.
  • Selection: choose a path by a condition (if, if-else, switch).
  • Iteration: repeat while a condition holds (while, do-while, for).

Everything nests inside blocks { } and functions, each with a single entry and a single exit. No wild jumping. C gives you exactly these tools, which is why it is called a structured language.

At a glance

The three control structures

StructureQuestion it answersC constructs
SequenceWhat happens next?Statements, one per line
SelectionWhich path do we take?if, if-else, switch
IterationHow many times?while, do-while, for

Quiz

Which of these is NOT one of the three structured-programming control structures?

  1. Arbitrary jumping (goto)
  2. Sequence
  3. Selection
  4. Iteration
Show the answer

Arbitrary jumping (goto)

Structured programming exists precisely to REPLACE arbitrary goto jumps with the disciplined three: sequence, selection, iteration. C still keeps a goto keyword for rare emergencies (you will meet it in Unit 2), but the whole point of the discipline is to almost never need it.

Think first

Preview your own program

Think ahead for the marks program: printing a student's name, then deciding pass or fail, then processing all 60 students of the class. Which of the three structures will each part use?

Show the answer

Printing lines in order: sequence (that is all the program has today). Pass or fail: selection, the if-else you will write in Unit 2. All 60 students: iteration, the loops right after. The entire subject's roadmap is literally the three structures, taught in order. That is not a coincidence; that is the syllabus following the theory.

Watch out

Where marks leak

Confusing structured with object-oriented: C is structured, not OOP; classes and objects belong to C++/Java in later semesters, and mixing the two terms in a definition costs marks. Second leak: naming the three structures vaguely ("loops and stuff"). Learn the trio as sequence, selection, iteration with one C construct each, that exact wording earns the definition marks.

Theory

Why this discipline pays your salary

Structured code is not aesthetics: it is why a teammate can fix your function without reading your whole program, why testers can test blocks in isolation, and why million-line systems are maintainable at all. Every code review you will ever sit in is quietly asking "is this structured?". The next lesson names the tools that take such code and make it run: editor, compiler, interpreter.

Summary

Key takeaways

  • Structured programming builds all logic from three structures: sequence, selection, iteration.
  • Code organises into blocks and functions with single entry and single exit.
  • Arbitrary goto jumps create spaghetti code; the discipline exists to avoid them.
  • C is a structured language; structured is NOT the same as object-oriented.
  • Benefits: top-to-bottom readability, isolated testing, teamwork.
  • Memory hook: sequence, selection, iteration, the only three shapes you need.

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from Introduction to C language

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Concepts of Structured Programming Language · Computer Programming and Programming Methodology (CPPM) · Gri-Learn