retagged by
11,653 views
37 37 votes

Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2.$$\begin{array}{|ll|ll|}\hline \rlap{\textbf{Group 1}} &  & \rlap{\textbf{Group 2}} \\\hline P. & \text{Functional} & 1. & \text{Common-based, procedural} \\ Q. & \text{Logic} & 2. & \text{Imperative, abstract data types} \\ R. & \text{Object-oriented} & 3. & \text{Side-effect free, declarative, expression evaluations} \\ S. & \text{Imperative} & 4. & \text{Declarative, clausal representation, theorem proving} \\\hline \end{array}$$

  1. $P-2\quad  Q-3\quad R-4\quad S-1$
  2. $P-4\quad Q-3 \quad R-2\quad S-1$
  3. $P-3\quad Q-4 \quad R-1\quad S-2$
  4. $P-3\quad Q-4\quad R-2\quad S-1$

5 Answers

Best answer
30 30 votes

Answer: (D) P-3 Q-4 R-2 S-1 $$\begin{array}{|ll|ll|}\hline \rlap{\textbf{Group 1}} &  & \rlap{\textbf{Group 2}} \\\hline P. & \text{Functional} & 3. & \text{Side-effect free, declarative, expression evaluations} \\ Q. & \text{Logic} & 4. & \text{Declarative, clausal representation, theorem proving} \\ R. & \text{Object-oriented} & 2. & \text{Imperative, abstract data types} \\ S. & \text{Imperative} & 1. & \text{Common-based, procedural} \\\hline \end{array}$$
Explanation:

P: Functional Programming is declarative in nature, involves expression evaluation, & side effect free.
Q: Logic is also declarative but involves theorem proving.
R: Object-oriented is an imperative statement based & have abstract (general) data types.
S: Imperative programs are made giving commands & follows definite procedure & sequence

Ref: https://www.geeksforgeeks.org/gate-gate-cs-2004-question-90/

edited by
12 12 votes

Functional programming, is declarative, and has no side effects. Hence P - 3.

Logic programming is theorem proving. Hence Q - 4.

Object oriented programming contains abstract data types (Abstraction is one of the properties) and is imperative. Hence R - 2.

Finally option S - 1.

Hence answer is D

10 10 votes

D should be the answer.

6 6 votes

Explanation: P: Functional Programming is declarative in nature, involves
expression evaluation, & side effect free.
Q: Logic is also declarative but involves theorem proving.
R: Object oriented is imperative statement based & have abstract
(general) data types.
S: Imperative: The programs are made giving commands & follows
definite procedure & sequence
 

4 4 votes

Functional languages like Haskell work around the principle of no side effect, which means operations don’t affect the state of the system(variables). Basically, variables are immutable in pure functional languages. They are declarative in the sense that we specify what we want just like we define recursive functions or expressions.

Logic languages like Prolog work on predicate logic and inference rules is widely used and thus are declarative. So it is like proving some theorems based on arguments given. 

Object Oriented languages like Java work on classes, which are nothing but implementations of abstract data types(ADT). They are imperative(procedural) in nature as we have methods(functions) to step-by-step show our actions.
 

Imperative languages like C  are procedural in nature, where we have to specify how we want to take steps, and give commands through function calls like doSomething(), moveRight(100) etc.

 

So, option (D) is obvious.
 

 

Answer:
Position:
Show:

Related questions

37 37 votes
3 answers 3 answers
13.6k
13.6k views
Kathleen asked Sep 18, 2014
13,628 views
The goal of structured programming is to:have well indented programsbe able to infer the flow of control from the compiled codebe able to infer the flow of control from t...
50 50 votes
4 answers 4 answers
9.9k
9.9k views
Kathleen asked Sep 12, 2014
9,885 views
Match the pairs in the following questions by writing the corresponding letters only.$$\begin{array}{|c|l|c|l|} \hline A. & \text{The number of distinct binary tree} & P....
13 13 votes
3 answers 3 answers
15.3k
15.3k views
Kathleen asked Sep 22, 2014
15,311 views
A common property of logic programming languages and functional languages is:both are procedural languages both are based on $\lambda$-calculusboth are declarativeboth us...
44 44 votes
6 answers 6 answers
21.9k
21.9k views
Kathleen asked Sep 18, 2014
21,855 views
Consider the following program fragment for reversing the digits in a given integer to obtain a new integer.Let $n = d_1\, d_2\, \ldots\, d_m$.int n, rev; rev = 0; while(...