0% found this document useful (0 votes)
11 views

Procedural Programming

Procedural programming revolves around a sequence of instructions given to the computer known as procedures. It takes a top-down approach by breaking problems into smaller functions. The code is organized into reusable blocks called functions that perform specific tasks by calling the right function at the right time.

Uploaded by

erisilala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Procedural Programming

Procedural programming revolves around a sequence of instructions given to the computer known as procedures. It takes a top-down approach by breaking problems into smaller functions. The code is organized into reusable blocks called functions that perform specific tasks by calling the right function at the right time.

Uploaded by

erisilala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Procedural

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.

• Top-Down Approach: Procedural programming takes a top-down


approach, starting with the most significant problem and breaking it
down into smaller, manageable functions.
• Functions: The code is organized into blocks called functions, each
performing a specific task. Writing a procedural program involves
calling the right function at the right time¹.
Sequence of Instructions:
• Data and Procedures Separation: Unlike object-oriented programming,
procedural programming treats data and functions (procedures) as
separate entities.
• Pre-defined Functions: These are standardized instructions included in
the programming language itself, usually in standard libraries. They
perform specific tasks like input/output operations or mathematical
calculations.
• Local and Global Variables: Procedural programming makes use of
local variables (defined within a function and not valid outside) and
global variables (accessible throughout the entire program).
Sequence of Instructions:
• Parameter Passing: Functions often work with data to produce a result,
and parameters are used to pass data into functions.
Basically, procedural programming revolves around a
sequence of instructions given to the computer. These
sequences of instructions are known as procedures.
The code is divided into reusable blocks (functions). Sequence Control: The program follows a specific sequence of operations. Local and Global Variables: width and height are local to main, while area is local to the s

• 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;

// Call the function and store the result


int area = calculateArea(width, height);

// Output the result


printf("The area of the rectangle is: %d\n", area);

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.

You might also like