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 are two dimensional arrays alternatively called as?

661


What do you mean by command line argument?

646


what are bit fields? What is the use of bit fields in a structure declaration?

1499


What is class and object in c?

589


Explain what is the general form of a c program?

624






Implement bit Array in C.

676


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1213


What is non linear data structure in c?

577


What is pass by reference in c?

615


What is scanf_s in c?

633


What does %c mean in c?

651


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

1659


Does free set pointer to null?

563


How to write a multi-statement macro?

624


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

606