main()
{
int x=10,y=15;
x=x++;
y=++y;
printf("%d %d\n",x,y);
}
output??
Answers were Sorted based on User's Feedback
Answer / mazrul
in x=x++;
the above expression is postfix
first we assign 10 into x then increment it by one so value
of x become 11
ic case of
y=++y;
is prefix expression firstly we increment value of y
then assign it to y.
so y become
y=16
| Is This Answer Correct ? | 53 Yes | 17 No |
Answer / gita
the answer is 10,16.
because x=x++;
means first assign after that that is incremented.
in case of y=++y;
first increment operation is performed. after that assigned.
| Is This Answer Correct ? | 18 Yes | 4 No |
Answer / subha raman
the answer is 10 and 16..
in the case of postfix,the value will be displayed first
[that is the difference between postfix and prefix]..
when the main function is again called and the value is
displayed it will b'com..11 and 17..
| Is This Answer Correct ? | 18 Yes | 15 No |
Answer / neha gupta
according to c standard they are undefined expressions.different compilers interpret answer in different way.
| Is This Answer Correct ? | 3 Yes | 0 No |
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 |
Answer / chandrakala
hai Mannu how it will become 35, 39. the answer is only 11
and 16 ok...
thanks
chandra
| Is This Answer Correct ? | 9 Yes | 10 No |
Explain how do you declare an array that will hold more than 64kb of data?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What does c value mean?
how the size of an integer is decided? - is it based on processor or compiler or OS?
19 Answers HCL, JPR, Microsoft, nvidia,
How the C program can be compiled?
int main() { int days; printf("enter days you are late"); scanf("%d",days); if (days<=5) printf("5o paisa fine"); if (days<=10&&days>=6) printf("1rs fine"); if(days>10) printf("10 rs fine"); if(days=30) printf("membership cancelled"); return 0; } tell me whats wrong in this program? is it right?
12345 1234 123 12 1
What is difference between far and near pointers?
What is the purpose of type declarations?
please give code for this 1 2 4 7 11 16
What is the purpose of 'register' keyword in c language?
what is output of the following statetment?Printf(“%x”, -1<<4); ?