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

Write a program to show the change in position of a cursor using c

585


What is the size of enum in bytes?

592


What is the difference between far and near in c?

604


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

683


What are local static variables?

622






Is c programming hard?

578


Difference between MAC vs. IP Addressing

644


Explain spaghetti programming?

684


What are the disadvantages of c language?

624


Under what circumstances does a name clash occur?

694


What does d mean?

589


How do you use a pointer to a function?

637


if p is a string contained in a string?

1406


Explain the use of bit fieild.

717


Write a program to print “hello world” without using semicolon?

677