Why the output of x in the programming is 0 instead of 1/2?
#include <stdio.h>
#include <stdlib.h>
int main()
{
double *xp,x;
xp = &x;
*xp = 1/2;
printf("%f\n",x);
return 0;
}
give the result of
0.000000