Features of Procedural Programming Language
- Local Variables: A local variable is a variable that is accessible within a specific part of a program and in procedural language local variable is accessible only in the function in which it is declared.
- Global Variables: A global variable is the one that is declared outside any function and can be accessed by any function of the program written. It is opposite of local variables.
- Modularity: The process of breaking a program into several modules or functions in such a way that each function performs a specific task is called modularity.
- Pre-defined Functions: Pre-defined function as the name suggests are the functions that are defined beforehand and doesn’t require programmer to define it. It is basically built in function and are already defined in the system libraries hence they are also called as library functions.
- Parameter Passing: Parameter passing is referred as a technique used to transfer data between various functions of the program. The data is passed in the form of parameters between the called function and the calling function.
What is Procedural Language?
Procedural Language is also known as 3GL which means third generation language. It is a type of programming language that follows a procedure; set of commands or guidelines that must be followed for smooth execution of the program. It works on step by step basis. It requires the user to tell not only What to do but also How to do it. Its basic idea is to have a program specify the sequence of steps that implements a particular algorithm. Hence, Procedural languages are based on algorithms.
In this developers use variables, loops, and functions to create a program performing a specific task which does calculations and displays a desired output.
It follows a top-down approach. It is carried out in a fixed sequence with a start and end point. The entire program is divided into functions and its main focus is on functions only. The program’s code executes linearly with logical steps. In this, the code is written first and executed with some conditions. The procedure calls to decide the conditions.
There are no data-hiding features in procedural language. It is command command-driven language. It is operated by means of commands keyed in by the user or issued by the program. In procedural language, both iterative and recursive calls are used. It works through the state of the machine. It returns only restricted data types and allowed values. It is highly efficient despite the fact the size of the program is quite large and is not suitable for critical applications with complex code. It takes a lot of time but it needs very less memory.
In procedural language, no access specifiers are used. For eg: In structure all the members are public.