what is the difference between i++ and ++i?

Answer Posted / geetha

i++ and ++i mean the same thing when they form statements
independently,they behave differently.
for example:
i=5;
d=++i;
in this case the value is i,d =6.bcoz first increment and
next assign the value
i=5;
d=i++;
in this case the value of d=5 and i=6.bcoz first assign the
value next increment and it will be change the value i=6.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a function that will take in a phone number and output all possible alphabetical combinations

592


What Is The Difference Between Null And Void Pointer?

632


Why C language is a procedural language?

612


Why is event driven programming or procedural programming, better within specific scenario?

1947


Is stack a keyword in c?

628






Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1488


What do you mean by dynamic memory allocation in c?

639


How do I read the arrow keys? What about function keys?

606


Explain what are multidimensional arrays?

590


how to find binary of number?

3413


Is it possible to use curly brackets ({}) to enclose single line code in c program?

782


Whats s or c mean?

587


Is null a keyword in c?

728


What is the difference between strcpy() and memcpy() function in c programming?

618


What is #include cctype?

570