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

Answer Posted / vivers

There are two different questions..
in which its asking the result for

1)(i++ + ++i)
answer will be---> 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"

2) (i+++++i)
answer will be---> compile error
"because illegal combination of operators"


best of luck...

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pointers?

621


Write a program of prime number using recursion.

607


Are the variables argc and argv are always local to main?

563


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2193


Can you explain the four storage classes in C?

635






What is static volatile in c?

568


What are header files and what are its uses in C programming?

623


Give basis knowledge of web designing ...

1565


Explain what is dynamic data structure?

636


Explain how can I read and write comma-delimited text?

638


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1456


What is the heap in c?

635


What is the difference between malloc calloc and realloc in c?

641


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

627


which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

1406