Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
hard

Logical Equivalence Analysis

Mark
< Prev
Next >

A program tests the truth value of a statement derived from De Morgan’s Law to verify logical equivalence.

What is printed when the following Java program is compiled and run?

public class QuestionTrace {

    public static void main(String[] args) {
        boolean p = true;
        boolean q = false;
        boolean res = !(p || q) == (!p && !q);
        System.out.print(res);
    }
}
A

true

B

1

C

0

D

false

Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|