What will be the output of
x++ + ++x?

Answer Posted / shivu

4

printf or any other expression executes from right. So first
prefix increment. then 2 and assigned to y. and will get add
with the result again, then it will increment.
now the value of x is 3. but the output is 4.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between abs() and fabs() functions?

601


What are predefined functions in c?

563


What are structures and unions? State differencves between them.

614


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

633


What is multidimensional arrays

627






What is structure padding and packing in c?

615


What is %d called in c?

755


Write a program to reverse a string.

632


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

1590


Can a void pointer point to a function?

566


What are the loops in c?

591


Are the variables argc and argv are local to main?

787


What are the disadvantages of external storage class?

586


What is the advantage of using #define to declare a constant?

617


Tell me what are bitwise shift operators?

656