Can some one help me? int x=10; x+=5; gives the gives the value of x as 5,15,6 or 16?
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"
is this a programming language?
yeh c programming
oh ok
So the answer should be 15 right?
Yes.
from what whpalmer says yes though i dont know C i've been told its difficult
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" :-)
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 :-)
hmm thanks answer is 15 or 5 I am sure but confusion is just semicolon.
Ok thanks a lot.
Join our real-time social learning platform and learn together with your friends!