Structured Programming

C is called a structured programming language because to solve a large problem, C programming language divides the problem into smaller structural blocks each of which handles a particular responsibility. These structural blocks are –

The program which solves the entire problem is a collection of such structural blocks. Even a bigger structural block like a function can have smaller inner structural blocks like decisions and loops.

Structured programming came into picture after the assembly language, ALGOL 58 and ALGOL 60. Let us go back to the time when structural support was not there in the programming languages. Programming languages used to use goto and jump type of statements to hop between different logical units. A bigger program used to be unorganized and difficult to understand. A need for structured programming came into picture and programming languages started introducing these block structures. Programming languages like C, BASIC, PASCAL, FORTRAN, COBOL gave support to structured programming methodologies.

C structural blocks

Statements and conditions

c condition and statements structural-blocks

Loops

c loops structural-blocks

Functions and procedures

c function procedure blocks

Structured blocks examples

Here is an example of Matrix addition program, which is divided into these sub procedures - input matrix, display matrix, add matrix, save result matrix to file. Here is a pictorial structural view of the program.

Matrix addition example

Another good example is calculate student's grade. Program is divided into these sub modules - input student marks, get student record, update student record, display student record, calculate grade. Here is a structural view of the program.

student grade example

Structured programming gave a good organization to programming blocks. But one major drawback is that similar functions cannot be grouped inside a module or class. Also functions cannot be associated to a type or structure. Thus data and functions cannot be bound together. C++ language overcomes these problems by introducing object oriented functionality in its programming capabilities. Object oriented programming is the next enhancement of all structured languages. C++, Java, C# and all modern programming languages support this capability.

Advantages

  • C structured programming is simple and easy to understand and implement.
  • It is well suited for small size implementation. However this is not restricted. A good design can extend it to large size implementation.
  • Programmers do not require to know complex design concepts to start a new program.

Disadvantages

  • Data and methods and not be bind together in a module.
  • Polymorphism and inheritance are not available.
  • Complex design and full object oriented design cannot be implemented.
  • Programmers generally prefer object oriented programming language over structured programming language when implementing a complex gaming applications or front end business applications.

If you ever need C programming assignment help online, don't hesitate to pay someone at AssignmentCore whose team of coding experts will do your programming homework fast and easily.

About our authors: Team EQA

You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.

#