please give me answer with details
#include<stdio.h>
main()
{
int i=1;
i=(++i)*(++i)*(++i);
printf("%d",i);
getch();
}

Answers were Sorted based on User's Feedback



please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i..

Answer / joe

The precedence of the operations, should be (reading from
left to right in the equation)

++i <first ++i i=2>
++i <second ++i i=3>
* <first product yields 3*3=9>
++i <third ++i i=4>
* <giving the second product 3*4=36>

Thus, the first product (*) is computed before the third ++i
is computed. Once the first product is completed, i is
incremented to i=4 and the second product can occur now.


Now, if you add some parentheses to the expression giving

++i * (++i * ++i)

then you will get 64, as the other replies suggest. Tracing
through the order of operations in this one

++i <first ++i i=2>
++i <second ++I i=3>
++i <third ++I i=4>
* <the product in the parentheses now yields 4*4=16>
* <the first * yields 4*16=64>

Here, the first product (*) cannot occur until it knows the
result of the product in the parenthesis. Thus, all three
increments must occur before the multiplications take place.

Is This Answer Correct ?    13 Yes 1 No

please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i..

Answer / gita

Answer is :64

Is This Answer Correct ?    7 Yes 7 No

please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i..

Answer / vaseem

++i * ++i * **i
->
2 3 4
now started this way
<-
4 * 4 * 4
=64

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More C Interview Questions

write a c code "if you give a any decimal number then print that number in english alphabet"? ex: i/p: 552 o/p: five hundred fifty two ...

1 Answers   Philips,


what is a pointer

4 Answers   Bank Of America, TCS,


write a c program to calculate the income tax of the employees in an organization where the conditions are given as. (I.T. = 0 if income <100000 I.T = 10% if income _< 200000 it = 20% if income >_ 200000)

7 Answers   Consultancy, DBU, FD, JK Associates, Kobe, Satyam,


Write any data structure program (stack implementation)

1 Answers   HTC,


What is modeling?

0 Answers  






What is the main differences between C and Embedded C?

9 Answers  


How do you define CONSTANT in C?

0 Answers   ADP,


please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i); printf("%d",i); getch(); }

3 Answers  


Which are low level languages?

0 Answers  


What are actual arguments?

0 Answers  


Explain demand paging.

1 Answers   Agilent,


please send me the code for multiplying sparse matrix using c

0 Answers  


Categories