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

What is use of bit field?

762


How do you define structure?

556


What is the difference between exit() and _exit() function?

594


What are conditional operators in C?

616


Why main is used in c?

579






What is switch in c?

636


Explain how can I convert a string to a number?

636


Explain what is the difference between functions abs() and fabs()?

611


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15479


Explain a pre-processor and its advantages.

613


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

606


Explain what are compound statements?

596


Why doesnt that code work?

597


What is return in c programming?

503


What is operator promotion?

618