Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q401: Which is an example of a fact in PROLOG?
- A: animal(X) :- isa(X, mammal).
- B: ?- animal(dog).
- C: isa(dog, mammal).
- D: H :- B1, B2.
View Answer
C
Q402: The term "isa(dog, mammal)." in PROLOG defines:
- A: A query
- B: A fact
- C: A rule
- D: A function
View Answer
B
Q403: PROLOG applications include all of the following EXCEPT:
- A: Expert systems
- B: Logical puzzles
- C: Compiling C++ code
- D: Artificial intelligence
View Answer
C
Q404: What does ":-" signify in a PROLOG rule?
- A: Equality
- B: Dependency
- C: Deduction
- D: Conjunction
View Answer
C
Q405: The query "?- isa(dog, X)." will return:
- A: X = bird
- B: X = mammal
- C: X = reptile
- D: No answer
View Answer
B
Q406: PROLOG primarily deduces information by:
- A: Syntax parsing
- B: Applying axioms
- C: Rule evaluation
- D: String matching
View Answer
C
Q407: Which of the following is NOT a use of PROLOG?
- A: Natural language understanding
- B: Web development
- C: Logical games
- D: Expert systems
View Answer
B
Q408: What kind of clauses does logic programming in PROLOG use?
- A: Horn clauses
- B: Boolean clauses
- C: Predicate clauses
- D: Recursive clauses
View Answer
A
Q409: In the rule "C :- A, B," what does it mean if both A and B are true?
- A: C is false
- B: C is true
- C: A is false
- D: B is irrelevant
View Answer
B
Q410: Which query would return "yes" in PROLOG?
- A: ?- animal(table).
- B: ?- isa(cat, fish).
- C: ?- animal(sparrow).
- D: ?- isa(bird, sparrow).
View Answer
C