Ask your own question, for FREE!
Mathematics 10 Online
OpenStudy (anonymous):

Can some one help me? int x=10; x+=5; gives the gives the value of x as 5,15,6 or 16?

OpenStudy (whpalmer4):

x is initially assigned the value 10. x += 5 takes the value of x, adds 5, and stores it back in x. you can think of it as shorthand for "x = x + 5"

OpenStudy (cwrw238):

is this a programming language?

OpenStudy (anonymous):

yeh c programming

OpenStudy (cwrw238):

oh ok

OpenStudy (anonymous):

So the answer should be 15 right?

OpenStudy (whpalmer4):

Yes.

OpenStudy (cwrw238):

from what whpalmer says yes though i dont know C i've been told its difficult

OpenStudy (whpalmer4):

There's a famous old remark about C: "C combines all the elegance and power of PDP-11 assembly language with all the readability and maintainability of PDP-11 assembly language" :-)

OpenStudy (whpalmer4):

If you want to do bit twiddling (writing device drivers, for example), it's relatively convenient. If you want to build something using object-oriented programming concepts, uh, not quite so convenient :-)

OpenStudy (anonymous):

hmm thanks answer is 15 or 5 I am sure but confusion is just semicolon.

OpenStudy (anonymous):

Ok thanks a lot.

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!