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
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is pass by reference in functions?
Explain data types & how many data types supported by c?
Should I learn c before c++?
Explain what is a program flowchart and explain how does it help in writing a program?
What are the different file extensions involved when programming in C?
Explain how can you tell whether two strings are the same?
Explain what happens if you free a pointer twice?
What is difference between function overloading and operator overloading?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Can you explain the four storage classes in C?
What are preprocessor directives in c?
Explain what is output redirection?
What is c preprocessor mean?