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);
}

Answers were Sorted based on User's Feedback



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

Answer / gaurav

5
12

Is This Answer Correct ?    35 Yes 14 No

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

Answer / mayank kumar

i=5
j=11

Is This Answer Correct ?    22 Yes 10 No

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

Answer / tamil selvam

i value is 2.
j value is 7.

Is This Answer Correct ?    19 Yes 9 No

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

Answer / gaurav

Please use gcc compiler....u will get answer 1,i.e. 5 and 12

Is This Answer Correct ?    10 Yes 3 No

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

Answer / rajesh kumar mahto

i=5 and j=11 (100% correct answer)
this is because
j=5+4+2(right to left execution)
i=5 due to latest updation of i.

Is This Answer Correct ?    9 Yes 5 No

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

Answer / kailas.s.patil

i = 2;
first ++i = 3.
second ++i = 4.
third i++ = 5;
now i =5;

then, j = 3 + 4 + 5 = 12

Is This Answer Correct ?    4 Yes 1 No

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

Answer / kapil

i=5
j=11


j=3+4+4; (i++ post increment)
after this step i value become 5(i++)

Is This Answer Correct ?    2 Yes 0 No

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

Answer / sanjay

i = 5
j = 11
It is because during the first pre-increment "++i" the compiler gets the value from the memory, increments it and stores it in the memory ie now i = 3. During the second pre-increment "++i" the compiler again gets the value from the memory, increments it, (value in the memory was 3) and so the incremented value is stored again in memory ie i = 4. during the post increment, the value from the memory is received and used in the statement ie) (the whole final statement looks like this ->>( 3 + 4 + 4) ) and then value of i is incremented and stored in memory. thus finally the value of i is 5 and j is 11.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / 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

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

Answer / lebin

value of i is 5
value of j is 12

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C Interview Questions

Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 2. Enter alphanumeric characters and form 2 array alphaets and digits.Also print the count of each array.

0 Answers  


? ???Mirror Mirror on the wall????????

1 Answers   channel V, DPI,


What is indirection in c?

0 Answers  


how to find out the union of two character arrays?

2 Answers  


a c code by using memory allocation for add ,multiply of sprase matrixes

0 Answers  


How can I write functions that take a variable number of arguments?

0 Answers  


Explain how can you tell whether two strings are the same?

0 Answers  


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

0 Answers  


What is external and internal variables What is dynamic memory allocation what is storage classes in C

3 Answers  


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a<b,printb.find the sum digits of that number & then print.if a==b multiply 10 with a & add 20 with b store in c and then print

0 Answers  


Where can I get an ansi-compatible lint?

0 Answers  


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

0 Answers  


Categories