Ask your own question, for FREE!
Mathematics 19 Online
OpenStudy (bahrom7893):

C++ folks, can you check my work?

OpenStudy (bahrom7893):

Let a = 12.1, b = 13.9, c = 14.4

OpenStudy (bahrom7893):

a) int(a)+b+c = 12 + 13.9 + 14.4 = 40.3

OpenStudy (bahrom7893):

b) int(a+b)+c = 26+14.4 = 40.4

OpenStudy (bahrom7893):

c) int(a+b+c) = 40.4

OpenStudy (anonymous):

are a, b, and c ints floats or doubles?

OpenStudy (bahrom7893):

the assignment doesn't say but i think they are doubles

OpenStudy (bahrom7893):

Here's the assignment:

OpenStudy (bahrom7893):

c) is 40 btw

OpenStudy (anonymous):

thats poorly written directions, anyways, if you have int(a) then the 12.1 will get cut off and will become 12.

OpenStudy (anonymous):

c should be 40 ...int are not supposed to have decimal with them . I 'm not sure but I think it should be 40

OpenStudy (bahrom7893):

yea that's what im doing, cuttin the integer off

OpenStudy (bahrom7893):

ishaan yea i already said c is 40, that was a typo..

OpenStudy (anonymous):

then your right i don't find any error

OpenStudy (bahrom7893):

okay tnx guys

OpenStudy (anonymous):

yes, it's all good. good job!

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!