C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
2. Outline
Structured programming language
Main features of Structured programming language
Unstructured programming language
Why C is structured programming language?
3. Structured Programming Language
Structured programming was first suggested by Corrado Bohm and
Guiseppe Jacopini. The two mathematicians demonstrated that any
computer program can be written with just three structures:
decisions, sequences, and loops.
In general, Structured programming can be seen as a subset or sub-
discipline of procedural programming, one of the major programming
paradigms. It is most famous for removing or reducing reliance on
the GOTO statement.
In programing languages that use the Structured programming
paradigm, we use of the structured control flow constructs of
selection (if/then/else) and repetition (while and for) block to
perform certain tasks within the program.
Structured programming is also known as modular programming.
4. Structured Programming
There are three main principles of structured
programming:
1. Program Design using top-down or bottom-up
approach.
2. Decomposition of program into components
3. Structuring of control flow
5. Main Features of Structured Programming
Language
1. Division of Complex problems into small procedures
and functions.
2. No presence of GOTO Statement
3. The main statement include – If-then-else, Call and
Case statements.
4. Large set of operators like arithmetic, relational, logical,
bit manipulation, shift and part word operators.
5. Inclusion of facilities for implementing entry points and
external references in program.
6. Unstructured Programming Language
A programming language in which the entire logic of the
program is written as a single continuous (nonstop or
unbroken) block is called "unstructured Programming".
Program written by following this language is very difficult
to modify and to debug
7. Difference between Structured and
Unstructured Programming Language
The main difference between structured and unstructured
programming language is that a structured programming language
allows a programmer to dividing the whole program into smaller
units or modules. But in unstructured programming language, the
whole program must be written in single continuous way; there is
no stop or broken block.
Structured Programming language is a subset of Procedural
Programming language. But in unstructured Programming language
no subset exists.
Structured Programming language is a precursor to Object
Oriented Programming (OOP) language. But another one is not.
8. Difference between Structured and Unstructured
Programming Language (cont..)
Structured Programming language produces readable code
while Unstructured Programming language produces hardly
readable code “spaghetti”.
Structured Programming language has some limitations while
unstructured Programming language offers freedom to program
as they want.
Structured Programming language is easy to modify and debug,
while unstructured Programming language is very difficult to
modify and debug.
Examples of Structured Programming language are C, C++; and
example of unstructured Programming language are BASIC
(early version), COBOL.
9. Why C language is Structured Language?
In order to accomplish any task, C-language divide the
problem into smaller modules called functions or
procedure each of which handles a particular job.That is
why C-language is also called as the structured
programming language.The program which solves the
entire problem is a collection of such functions.
10. Why C language is Structured Language?
In C Programming when writing a program we add preprocessor directive
#inclue <filename> , than functions like main() , then opening of braces { }
, inside the braces there are two parts declaration of variables and
execution of statements which is a step by step process and well
structured so anyone in the first look can understand what codes are
doing what in which section.
The structured programming languages allows the program to be splied
into multiple blocks of execution.
In C, you can split the program into such named blocks called functions.
That is why it is called a structured programming language.
11. Features of C Programming Language
Low Level Language Support
Program Portability
Powerful
Manipulation
High Level Features
Modular Language
Efficient Use of Pointers
12. Features of C Programming Language
(cont..)
The future of the C language is very secure.This is
because the choice of programming language for any
application depends on the nature of the application
itself.
C has been around for many years and has a
dedicated community of users.
It has also a lot of online resources, a clean syntax
and is easy to learn and use. So it is safe to say that C
isn't going anywhere.
13. Advantages of C Programming
C Programs are efficient, fast and Highly Portable .
It can be written in one computer and can be run in
another one without any modification .
It is easy for debugging, error finding, testing and
maintenance because of structured programming.