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
Write a program to show the change in position of a cursor using c
What is the size of enum in bytes?
What is the difference between far and near in c?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What are local static variables?
Is c programming hard?
Difference between MAC vs. IP Addressing
Explain spaghetti programming?
What are the disadvantages of c language?
Under what circumstances does a name clash occur?
What does d mean?
How do you use a pointer to a function?
if p is a string contained in a string?
Explain the use of bit fieild.
Write a program to print “hello world” without using semicolon?