main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
what is the output?
Answer Posted / sagar
here first in x = y++ + x++;
= (35+1) + (20+1);//here value of x is not
= 36 + 21; assigned to 21 as x++
= 57... and 'lly to y++....
now the value of x = 57.
now for y = ++y + ++x;
= (1+35) + (1+57);
= 36 + 58;
= 94...
therefore,after performing all operatioins we get,
x==57 And y==94....
Is This Answer Correct ? | 6 Yes | 4 No |
Post New Answer View All Answers
Can a variable be both const and volatile?
What is wrong with this statement? Myname = 'robin';
What the advantages of using Unions?
What's the total generic pointer type?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
What are unions in c?
Explain how to reverse singly link list.
How does normalization of huge pointer works?
How do you print only part of a string?
Why is c called a mid-level programming language?
Explain what are the advantages and disadvantages of a heap?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
How can I handle floating-point exceptions gracefully?
What are the different file extensions involved when programming in C?
What are keywords c?