#include<stdio.h>
main()
{
double d=3.2,x;
int i=2,y;
x=(y=d/i)*2;
printf(“%g\t %g\n”,(double)x,(double)y);
y=(x=d/i)*2;
printf(“%g\t %g\n”,(double)x,(double)y);
y=d*(x=2.5/d);
printf(“%g\n”,(double)y);
x=d*(y=((int)2.9+1.1/d));
printf(“%g\t %g\n”,(double)x,(double)y);
return 0;
}
its output is:
2 1
1.6 3
2
6.4 2
ques ? how x=(y=1)*2 is 2.
x=(y=1)*2;
first of all ,solve the expression with in the berackets i.e (y=1) it means you are going to multiply ‘y’ with 2 ,here y is 1
take another example suppose x=(y=2)*6;
your answer will be 12 ,
2 is assigning to y and then the value of y is being multiplied by 6..
thnx bro…now i can tyr this ques