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
How can I sort a linked list?
Why dont c comments nest?
Explain what is the difference between functions abs() and fabs()?
Explain what is the benefit of using an enum rather than a #define constant?
Differentiate Source Codes from Object Codes
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Explain what is a static function?
Can we replace the struct function in tree syntax with a union?
Why do we use return in c?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
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
Suggesting that there can be 62 seconds in a minute?
What is the g value paradox?
Who developed c language and when?