Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Multiple Choice Questions

Q411: In Prolog, which type of constant begins with a lowercase letter?
  • A: Numbers
  • B: Atoms
  • C: Variables
  • D: Compound Terms
View Answer
B

Q412: Which of the following is an example of a quoted atom in Prolog?
  • A: apple
  • B: ‘hello world’
  • C: &
  • D: studies
View Answer
B

Q413: In Prolog, variables must begin with what type of character?
  • A: Lowercase letter
  • B: Uppercase letter
  • C: Digit
  • D: Special character
View Answer
B

Q414: What symbol is used to indicate comments in Prolog?
  • A: //
  • B: #
  • C: %
  • D: ;
View Answer
C

Q415: In Prolog, the relationship and objects in facts must be separated by:
  • A: Periods
  • B: Commas
  • C: Semicolons
  • D: Colons
View Answer
B

Q416: The Prolog rule snowy(X) :- rainy(X), cold(X). means:
  • A: Snowy is true if rainy is false
  • B: Snowy is true if both rainy and cold are true
  • C: Snowy is true if either rainy or cold is true
  • D: Snowy is always true
View Answer
B

Q417: What does Propositional Logic primarily deal with?
  • A: Numbers
  • B: Boolean statements
  • C: String manipulation
  • D: Database queries
View Answer
B

Q418: What is the meaning of the statement ¬p in propositional logic?
  • A: p is true
  • B: p and q are true
  • C: Ahmed is not father of Belal
  • D: Ahmed is father of Belal
View Answer
C

Q419: In Prolog, the statement studies(ali, programming). represents:
  • A: A rule
  • B: A fact
  • C: A query
  • D: A comment
View Answer
B

Q420: The statement p ∧ q ⇒ r in propositional logic means:
  • A: Ahmed is not father of Belal
  • B: Ahmed is father of Belal or brother of Aslam
  • C: If Ahmed is father of Belal and brother of Aslam, then Aslam is uncle of Belal
  • D: None of the above
View Answer
C

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now