#include<stdio.h>
int 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;
}
Make changes in the code as shown below:
printf(“%g\t%g\n”,(double)x,(double)y);
printf(“%g\t%g\n”,(double)x,(double)y);
printf(“%g\n”,(double)y);
printf(“%g\t%g\n”,(double)x,(double)y);
Whenever we want to do any typecasting from one data type to another the general syntax is:
(data type)variable_name;
thanks sir