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

#include<stdio.h>
int main()
{
int i=2;
int j=++i + ++i + i++;
printf("%d\n",i);
printf("%d\n",j);
}

Answer Posted / vadim g

i=5 and j=12

Here is the sequence of operations:
1. i = 2 => result i = 2
2. first ++i => result: i = 3
3. second ++i => result: i = 4
4. j assignment => result: j = 4 + 4 + 4 = 12
5. i post increment => i = 5

MSVC++ gives 5 and 12.

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know what are the properties of union in c?

1084


What header files do I need in order to define the standard library functions I use?

1064


What are keywords in c with examples?

1091


How many levels deep can include files be nested?

1144


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

2046


What does the c in ctime mean?

1100


What is the explanation for the dangling pointer in c?

1117


Explain how to reverse singly link list.

1154


Why array is used in c?

1026


What are valid signatures for the Main function?

1241


Can an array be an Ivalue?

1102


What is the need of structure in c?

1126


What is typedef struct in c?

1058


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1351


Explain modulus operator. What are the restrictions of a modulus operator?

1022