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

What is the value of the variable? double dNum = (double)10/3;

SourMunchkin7806:

So this is 3.33333?

Ultrilliam:

3.3333333333333335 (it rounds up towards the end, if it goes on into infinity)

SourMunchkin7806:

ok

SourMunchkin7806:

so what about his one since its the same one What is the value of the variable? double dNum = (double)(10/3);

Ultrilliam:

3.0

SourMunchkin7806:

So how come this one is different?

Ultrilliam:

It's being isolated by the parenthesis, turning it into a int. then back to a double adding the .0 or something to that extent

SourMunchkin7806:

ohhh ok

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!