Selft training repo
Procedural programming organizes code into reusable procedures or functions that operate on data. It emphasizes the use of procedures to encapsulate behavior and separate it from data.
The example is a C program that defines a function to calculate the sum of two numbers and prints the result.
#include <stdio.h>
int sum(int a, int b) {
return a + b;
}
int main() {
int result = sum(3, 4);
printf("Result: %d\n", result);
return 0;
}
The first major procedural programming languages appeared circa 1957–1964, including Fortran, ALGOL, COBOL, PL/I and BASIC. Pascal and C were published circa 1970–1972.