menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
Is the expression a || b the same as a && !b
asked
Oct 11, 2018
189k
views
5
votes
Is the expression a || b the same as a && !b
Computers and Technology
high-school
Ikesha
asked
by
Ikesha
8.6k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
2
Answers
2
votes
You could test it
case (1)
a =true, b=false
true || false = true
true && !false = true
PASSED!
a=false b= true
false || true = true
false && !true = false
FAILED!
also try a=true, b =true
so the it is not the same
Jovanka
answered
Oct 14, 2018
by
Jovanka
9.1k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
4
votes
Most definitely not!
A || B is A OR B, if A is true OR B is true, the statement will be true. A && !B is A AND !B, only if A is true AND B is false will the statement be true. With OR, B can be true and the statement will pass.
Joe Bowbeer
answered
Oct 17, 2018
by
Joe Bowbeer
8.0k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Dec 23, 2024
156k
views
On the grid, draw the graphs of y = x + 2 and x + y = 3. Use the graphs to solve the simultaneous linear equations y = x + 2 and x + y = 3 4 3 +44 2 10 && # 4 2 3 2 3 4 5 X X = Answer y = Answer
Manishekhawat
asked
Dec 23, 2024
by
Manishekhawat
8.0k
points
Mathematics
high-school
1
answer
0
votes
156k
views
asked
Oct 21, 2024
151k
views
Which of the following expressions represents a legal way of checking whether a value assigned to the "num" variable falls in the range 100 to 200 (inclusive)? a) 100 <= num <= 200 b) num >= 100 && num <= 200 c) num => 100 || num =< 200 d) num > 100
Sinoohe
asked
Oct 21, 2024
by
Sinoohe
9.0k
points
Mathematics
high-school
1
answer
0
votes
151k
views
asked
Jun 2, 2024
21.1k
views
Please design tests that satisfy RACC for the program below. Please provide necessary steps of generating the tests.public String twoPred (int x, int y) { boolean z; if (x < y) z = true; else z = false; if (z && x+y == 10) return "A"; else return "B"; }
Jacob Poul Richardt
asked
Jun 2, 2024
by
Jacob Poul Richardt
7.7k
points
Engineering
college
1
answer
5
votes
21.1k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.5m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
If a person sends email from a school computer or a business computer, should that message be considered private? Does the institution or person that owns the computer from which email is sent have a right
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org