Difference between various paradigms
Programming paradigm is another method of classification of programming languages. Examples of paradigms include procedural paradigm (BASIC, COBOL, Ada), object-oriented paradigm (Java, C++), declarative paradigm (Prolog) and functional paradigm (LISP, Scheme), event-driven paradigm (VB, C#).
The primary differences between each type of programming paradigms are described below.
Example of language that support all paradigms:
There are various programming languages that support more than one paradigm. For example Visual Basic is an even-driven programming language but it facilitates to create objects as well as DBMS programming. It can also use facts and rules for describing problems.
Refer to the following code given in the question:
For n = 1 To 5
Print "Loop number" n
• For-loop is a programming language statement which is used to repeatedly execute any statement to number of times. It is also called as iteration statement.
• Each for-loop has starting and terminating condition which states the number of times a loop iterates.
So, the output of the above code will be:
Loop number 1
Loop number 2
Loop number 3
Loop number 4
Loop number 5
As the for-loop contains 'For n = 1 To 5' statement, it means that the loop will continue to execute till n is 5 or less. Therefore, this program prints five lines of text.
Generations of Computer Languages
There are five generations of computer languages. All the five generation languages are described below:
1. First Generat ion: The First Generation language is also known as Machine Language that is represented as in the series of 0's and 1's. The machine code is efficient but difficult to write.
2. Second Generation: The Second Generation Language is also known as Assembly Language. These are also known as mnemonics that are converted in the form of machine language.
3. Third Generation: The Third Generation Language is also known as High Level Language. They are designed to solve the general Problems. COBOL, C++ are third generation language. The source code is translated into machine language depending on the language.
This generation uses the platform independent syntax. This generation uses the third generation languages like FORTRAN, COBOL and BASIC.
4. Fourth Generation: The Fourth Generation Language is also known as Problem-oriented Language. It is a part of DBMS systems.
Following languages were used in this generation:
• Query Language: SQL is one of the Query Language.
• Application Generators: MS Access is one of the examples of Application Generators.
This generation uses all the higher level languages like C and C++, DBASE, etc., were used in this generation.
5. Fifth Generation: The Fifth Generation Language is also known as Natural Languages and Visual Programming.Microsoft Visual Basic is the example of Fifth Generation Language.
The relation of low level and high level languages with the five generations of computer languages is shown below: