Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Chapter: 26
Q461:
What does the predicate aggravates(Drug, Condition) signify in Prolog?
A. The drug helps alleviate the condition
B. The drug causes the condition
C. The drug is unrelated to the condition
D. The drug cures the condition
Correct Answer: B
Chapter: 26
Q462:
In Prolog, which built-in feature generates readable and maintainable code?
A. Syntax analysis
B. Tree formation and backtracking
C. Type checking
D. Optimization
Correct Answer: B
Chapter: 26
Q463:
Ali suffers from peptic ulcers. Which drug is suitable for his headache?
A. aspirin
B. new_med
C. anti-diarrhea
D. penicilline
Correct Answer: B
Chapter: 26
Q464:
Which of the following is NOT a use case for Prolog?
A. Language processing
B. Game playing
C. Operating system development
D. Knowledge representation
Correct Answer: C
Chapter: 26
Q465:
Which of the following is a side effect of "aspirin"?
A. diabetes
B. fever
C. peptic_ulcer
D. nasal_congestion
Correct Answer: C
Chapter: 26
Q466:
Fill in the blank: Prolog uses ______ to avoid infinite loops caused by left recursion.
A. efficient type-checking
B. backtracking
C. tree formation
D. strict standardization
Correct Answer: B
Chapter: 26
Q467:
In the clause should_take(Person, Drug), what does the predicate not(unsuitable_for(...)) check?
A. Whether the drug relieves a symptom
B. Whether the drug aggravates a condition
C. Whether the drug is suitable for the person
D. Whether the person complains about the drug
Correct Answer: C
Chapter: 26
Q468:
What type of programming language is Prolog?
A. Object-oriented
B. Functional
C. Declarative
D. Procedural
Correct Answer: C
Chapter: 26
Q469:
Which drug is used to relieve severe pain?
A. aspirin_codine_combination
B. bis_cure
C. penicilline
D. de_congest
Correct Answer: A
Chapter: 26
Q470:
What feature of Prolog makes it easier to achieve inference tasks compared to imperative languages?
A. Built-in tree formation and backtracking
B. Case sensitivity
C. Optimization techniques
D. Code modularity
Correct Answer: A
Chapter: 26
Q471:
Which drug aggravates asthma?
A. anti-diarrhea
B. de_congest
C. aspirin
D. bis_cure
Correct Answer: C
Chapter: 26
Q472:
Fill in the blank: Prolog suffers from lack of ______, making it harder to standardize.
A. performance optimization
B. type-checking mechanisms
C. strict type requirements
D. standardization
Correct Answer: D
Chapter: 26
Q473:
What is one of the challenges in writing Prolog programs?
A. Steep learning curve
B. Overly concise syntax
C. Lack of built-in functions
D. Overdependence on recursion
Correct Answer: A
Chapter: 27
Q474:
Which programming language is Java based on?
A. C++
B. JavaScript
C. Python
D. Swift
Correct Answer: A
Chapter: 27
Q475:
Java supports which type of programming paradigm?
A. Object-oriented programming
B. Procedural programming
C. Functional programming
D. Declarative programming
Correct Answer: A
Chapter: 27
Q476:
What does the "Hello World" program in Java output?
A. Hello Universe
B. Hello Java
C. Hello World
D. Hello Program
Correct Answer: C
Chapter: 27
Q477:
Which function is the entry point for a Java program?
A. start()
B. run()
C. launch()
D. main()
Correct Answer: D
Chapter: 27
Q478:
What type of data type is "boolean" in Java?
A. Primitive
B. type
C. Array
D. class
Correct Answer: A
Chapter: 27
Q479:
Which of the following is NOT a primitive type in Java?
A. int
B. long
C. Reference
D. byte
Correct Answer: D
Chapter: 27
Q480:
What does Java NOT support?
A. Multiple inheritance
B. Polymorphism
C. Encapsulation
D. Abstraction
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now