Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (bahrom7893):

Guys need your help again

OpenStudy (bahrom7893):

I have to determine if this is true (a = 5, b=2): Is !(a*b) true?

OpenStudy (bahrom7893):

but what is: !(a*b), actually let me check my notes haha

OpenStudy (amistre64):

looks like not(a*b) to me :/

OpenStudy (bahrom7893):

yea but what is not (a*b), that's what i dont get

OpenStudy (anonymous):

a * b = 10 = true !(10) = false (not)(true)

OpenStudy (bahrom7893):

ohh lol nice!

OpenStudy (bahrom7893):

so anything !(a+b), etc.. will all be false?

OpenStudy (amistre64):

if (a == 5 && b == 2) {cout<<"true"}; perhaps not :)

OpenStudy (anonymous):

>>> not (5*2) False http://codepad.org/lcOkkOs6

OpenStudy (bahrom7893):

I don't know python and i'm just takin C++ and this is my 2nd week so for !(c%b) that would also be false?

OpenStudy (anonymous):

amistre64 that is not boolean logic.

OpenStudy (bahrom7893):

% is modular division

OpenStudy (bahrom7893):

c=4 b=2

OpenStudy (bahrom7893):

true

OpenStudy (bahrom7893):

it will be true.. since: (4%2) <= false

OpenStudy (bahrom7893):

not(false) <=true, right?

OpenStudy (anonymous):

4%2=0=false not false true

OpenStudy (bahrom7893):

i see tnx guys

OpenStudy (amistre64):

Boole is dead by now; i tend to use amistre64-ean logic :)

OpenStudy (anonymous):

http://codepad.org/QekoRk8s Here is the code it is quite simple to evaluate boolean logic.

OpenStudy (anonymous):

Boole will always be alive in our hearts ;)

OpenStudy (bahrom7893):

what the heck is this?

OpenStudy (bahrom7893):

c % b * a && a % c * b

OpenStudy (bahrom7893):

c%b is false false*a is false*true is false

OpenStudy (anonymous):

What are the values of a, c, and b?

OpenStudy (bahrom7893):

false and a%c * b false and true * true false and true true

OpenStudy (bahrom7893):

a=5 b=2 c=4

OpenStudy (anonymous):

false AND true = false

OpenStudy (bahrom7893):

woops sorry meant false haha

OpenStudy (anonymous):

yes, you got it. :)

OpenStudy (bahrom7893):

what is false OR true?

OpenStudy (bahrom7893):

true?

OpenStudy (anonymous):

True

OpenStudy (bahrom7893):

ok tnx.. hold on double check my assignment..will post a new thread

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!