main()
{
int x=10,y=15;
x=x++;
y=++y;
printf("%d %d\n",x,y);
}

output??

Answer Posted / shruti

the ans is 11 and 16..

y = ++y;

wont make any differance as a statement.

we will have to think about it only if we are using it in
loops.. or conditional statements etc.. :-)

so dont get confused.
dont forget ur basics..

C is a procedural language.
hence

x = x++;
will be completely executed first
the value of x = 11.

and then

y = ++y;
will be executed and value will be changed to 16

Is This Answer Correct ?    11 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I sort a linked list?

633


Why dont c comments nest?

615


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

613


Explain what is the benefit of using an enum rather than a #define constant?

714


Differentiate Source Codes from Object Codes

814






What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

670


What is the difference between declaring a variable by constant keyword and #define ing that variable?

2696


Explain what is a static function?

628


Can we replace the struct function in tree syntax with a union?

774


Why do we use return in c?

565


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

600


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

622


Suggesting that there can be 62 seconds in a minute?

594


What is the g value paradox?

643


Who developed c language and when?

575