Comparison of Programming Paradigms

Compare and Contrast Three Different Paradigms

Problem:

Prime and Composite numbers are 2 categories under which the natural numbers greater than 1 are classified in mathematical world. Composite numbers are natural numbers greater than 1 and could be expressed as a product of 2 smaller natural numbers. All non-composite natural numbers greater than 1 are called Prime Numbers.

Now, let us investigate this problem in terms of various Programming Paradigms:

Imperative Paradigm:

Object-Oriented Paradigm:

Logic Paradigm:

Comparison:

Data Science enthusiast with interest in problem solving.