Procedural Programming
Procedural Programming
programming
By: Crizha Keith Bartocillo & Fjaen Dariagan
Procedural programming
• Procedural programming is one of the earliest paradigms developed for
high-level programming and is still widely used today, especially in
software development. It's known for its structured approach and is
particularly effective for tasks that can be broken down into logical
steps and procedures.
Key concepts and components of
procedural programming
• Sequence of Instructions
• Top-Down Approach
• Functions
• Data and Procedures Separation
• Pre-defined Functions
• Local and Global Variables
• Parameter Passing
Sequence of Instructions:
It revolves around a sequence of instructions given to the computer,
known as procedures.
• Code( C )
This code illustrates several key aspects of procedural programming:
Modularity: The code is divided into reusable blocks (functions).
#include <stdio.h>
Sequence Control: The program follows a specific sequence of
operations.
// Function to calculate the area of a rectangle
Local and Global Variables: width and height are local to main, while
int calculateArea(int width, int height) { area is local to the scope of main.
return width * height; Parameter Passing: Data is passed to functions through parameters.
}
int main() {
int width = 10;
int height = 5;
return 0;
}
Procedural programming is effective for tasks that can
be broken down into steps and procedures, making the
code easier to understand, debug, and maintain.