Programming with C

⌘K
  1. Home
  2. Docs
  3. Programming with C
  4. Basics of C Programming
  5. Introduction to Programmi...
  6. Procedural Programming

Procedural Programming

Procedural Programming

  • A program is divided into subroutines that can access global data.
  • To avoid repetition of code, each subroutine performs a well-defined task
  • A subroutine that needs the service provided by another subroutine can call that subroutine
  • Using ‘jump, ‘goto’ and ‘call’ instructions, the sequence of execution of instructions can be altered
  • Example: FORTRAN, COBOL

Structure of Procedural Programming

Features

  • Large Programs are divided in to small function or Procedure.
  • Uses Top-Down programming Approach.
  • Data moves freely from one function to another.
  • Most of the functions share common data.
  • Emphasis is given for algorithms.

Advantages

  • The source code is portable, therefore, it can be used to target a different CPU as well
  • The code can be reused in different parts of the program, without the need to copy it
  • Through Procedural Programming technique, the memory requirement also slashes
  • The program flow can be tracked easily

Disadvantages

  • The Procedural code is often not reusable, which may pose the need to recreate the code if is needed to use in another application
  • The importance is given to the operation rather than the data, which might pose issues in some data-sensitive cases
  • The data is exposed to the whole program, making it not so much security friendly

Views: 1

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments