main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}

Answer Posted / arif shaik

main()
{
int x=20,y=35;
x=y++ + x++;//x=(y+1) + (x+1) here y=35,x=21
//x=36 + 21 = 57
//x=57 ;here previous x=21 is overwritten by 57
y=++y + ++x;//y=(1+y) + (1+x) here y=35, x=58 bcoz y
value refers y's initial address which contain 35 then
//y=(1+35) + (1+57)=36+58= 94
printf("%d %d\n",x,y);
}

Output:

57 94

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the scope of static variable in c?

537


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

1908


Can you please explain the difference between strcpy() and memcpy() function?

606


Explain what is a stream?

613


List some applications of c programming language?

560






How can I implement sets or arrays of bits?

609


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1204


The difference between printf and fprintf is ?

720


Do pointers need to be initialized?

568


Is multithreading possible in c?

571


What are the application of void data type in c?

722


What is the use of #include in c?

585


What header files do I need in order to define the standard library functions I use?

543


What is the purpose of main( ) in c language?

628


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

723