Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

how this inerement and decerement operator works in c,bcoz inmgetting difrent output in c and java

OpenStudy (p0sitr0n):

in both languages, increment can be written as i++, ++i , i+=1, i=i+1 However, note that i++ and ++i are slightly different

OpenStudy (rsmith6559):

Pre and post increment/decrement operators both work the same in C, C++, Java, JavaScript and a bunch of other languages. i = 0; ++i; // will evaluate to 1, this is pre-increment, the increment happens before i is evaluated i++; // will evaluate to 1, this is post-increment, i is evaluated, then incremented // now i == 2 The decrement operators are the same.

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!