Ask your own question, for FREE!
Computer Science 8 Online
SourMunchkin7806:

Which of the following expressions will evaluate to true? 12 / 5 != 2.0 12 / 5.0 == 2.0 (int)(12.0 / 5.0) == 2.0

SourMunchkin7806:

@JustSaiyan

JustSaiyan:

All of the nope. @Ultrilliam Wake your Air up

SourMunchkin7806:

Lol thanks anyways aha

JustSaiyan:

I thought maybe it would be like my computer science class. "Where is the alt key located?" XD

JustSaiyan:

I had that class dropped.

SourMunchkin7806:

bahahahha dude why

JustSaiyan:

Because it felt insulting, I know how to use a computer, LOL.

SourMunchkin7806:

Oh shiiiiiiiiiiiiiit i gotta get to my training thanks again for trying bro

JustSaiyan:

i'll wake up ultri, lol

mhchen:

12/5.0 becomes 2.4 since integer/double = double. 2.4 == 2.0 will become false

mhchen:

(int)(12.0/5.0) becomes (int)(2.4) which becomes 2. an integer. 2 == 2.0 evaluates to true

mhchen:

12/5 becomes 2 since integer/integer is an integer. 2 != 2.0 will evaluate to false.

Ultrilliam:

^Beat me to it, have a medal

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!