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

Answer Posted / ravinder

Ans 12,
as addition will takes place from left to right
step1: i++ = 5;
step2: value of i will be updated before taking value of
another operand and hence i = 6;
step3: ++i = 7 as first increment will happen and then value
will be used.
final result: 5 + 7 = 12;

Is This Answer Correct ?    24 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

660


What is pass by reference in functions?

327


Explain data types & how many data types supported by c?

588


Should I learn c before c++?

625


Explain what is a program flowchart and explain how does it help in writing a program?

653






What are the different file extensions involved when programming in C?

764


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

587


Explain what happens if you free a pointer twice?

615


What is difference between function overloading and operator overloading?

664


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

635


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

712


Can you explain the four storage classes in C?

646


What are preprocessor directives in c?

643


Explain what is output redirection?

670


What is c preprocessor mean?

797