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...

main()
{ int i=5;
printf("%d",++i + i);

} output is 10

------------------------
main()
{ int i=5;
printf("%d",i++ + i);

}output is 12
why it is so? give appropiate reason....

Answer Posted / ashi smita

in first program i is post increment than i=5 and i=5+5=10
than i is increment by 1 and the value of i is 6 but second
program first i is preincrement by 1 and the value of is 6
than sum of i is 12.

Is This Answer Correct ?    3 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I generate floating-point random numbers?

1125


How to declare a variable?

999


What is typedef?

1407


What do you mean by a sequential access file?

1074


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜n’ element.

2100


How do I create a directory? How do I remove a directory (and its contents)?

1165


What is the use of extern in c?

1092


What does c mean?

1038


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1162


Why are algorithms important in c program?

1114


What is function definition in c?

1075


How would you use the functions fseek(), freed(), fwrite() and ftell()?

1161


Find MAXIMUM of three distinct integers using a single C statement

1058


In C language what is a 'dangling pointer'?

1133


Explain the difference between null pointer and void pointer.

1077