Skip to content
Official PYQ · 2004

GATE CS 2004 Q90 — Programming in C

Explain with AI

Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2.Group 1Group 2P.Functional1.Common-based, proceduralQ.Logic2.Imperative, abstract data typesR.Object-oriented3.Side-effect free, declarative, expression evaluationsS.Imperative4.Declarative, clausal representation, theorem proving\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}

Choose one option
View worked solution

Answer: D

We can match each programming paradigm in Group 1 with its defining characteristics in Group 2:

  • P. Functional Programming →\rightarrow 3. Side-effect free, declarative, expression evaluations
    Functional programming (e.g., Haskell, Lisp) treats computation as the evaluation of mathematical functions. It avoids state changes and mutable data, making it side-effect free.
  • Q. Logic Programming →\rightarrow 4. Declarative, clausal representation, theorem proving
    Logic programming (e.g., Prolog) is declarative and expresses programs in terms of relations and logical clauses (like Horn clauses). Execution is driven by a system of theorem proving.
  • R. Object-oriented Programming →\rightarrow 2. Imperative, abstract data types
    Object-oriented programming (e.g., C++, Java) builds upon the imperative paradigm by encapsulating state and behavior into classes, which represent abstract data types.
  • S. Imperative Programming →\rightarrow 1. Common-based, procedural
    Imperative programming (e.g., C, Pascal) is command-based (procedural), where the program consists of explicit instructions that change the program state.

Thus, the correct matching is P-3, Q-4, R-2, S-1, which corresponds to Option D.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Programming in C questions