Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Explain what is the best way to comment out a section of code that contains comments?

1096


How can a number be converted to a string?

1242


How do I swap bytes?

1023


What are pragmas and what are they good for?

936


What is the modulus operator?

1152


can we have joblib in a proc ?

2231


What is structure of c program?

1078


Write a program to print "hello world" without using a semicolon?

1004


What is a stream?

1078


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1217


Can you please explain the scope of static variables?

998


What is a scope resolution operator in c?

1206


What is .obj file in c?

1023


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2579


What is sizeof in c?

955