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


Please Help Members By Posting Answers For Below Questions

Can a variable be both const and volatile?

676


What is wrong with this statement? Myname = 'robin';

822


What the advantages of using Unions?

673


What's the total generic pointer type?

614


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

721






What are unions in c?

582


Explain how to reverse singly link list.

606


How does normalization of huge pointer works?

641


How do you print only part of a string?

615


Why is c called a mid-level programming language?

729


Explain what are the advantages and disadvantages of a heap?

597


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

874


How can I handle floating-point exceptions gracefully?

636


What are the different file extensions involved when programming in C?

758


What are keywords c?

603