KnowledgeBoat Logo

Computer Applications

Distinguish between (p != q) and !(p == q)

Java Operators

92 Likes

Answer

(p != q)!(p == q)
This expression uses the relational operator != (Not equal to) to determine if values of p and q are different.This expression first checks if values of p and q are equal using the relational operator == (equality). It then inverts the result of equality operator using the logical NOT (!) operator to determine if values of p and q are different.

Answered By

50 Likes


Related Questions