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

Answer Posted / prem

if x=3
y=x++ + ++x;
y will be 8
x will be 5

calculating y part
1) x++ is 3 and x will be 4
2)++x is 5 bcz x is incremented then assigned so x=5

so y finally gives 8.

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between typedef and #define?

527


What are the types of functions in c?

558


write a program in c language to print your bio-data on the screen by using functions.

6229


Can you apply link and association interchangeably?

661


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

593






How can I read a binary data file properly?

620


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

596


What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

1337


How do I swap bytes?

617


What are directives in c?

533


What is operator promotion?

615


How can I read and write comma-delimited text?

604


Explain how can I convert a number to a string?

632


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

1609


Differentiate between the = symbol and == symbol?

695