I am writing code to find the distance of a point(25,40000) from a fixed point(47,132000). The distance always printed to be 0.0000. I have tried checking other combinations, giving smaller values of points, and printing them with %d, it works great. But with %ld,%lf,%Lf something is not fine. Kindly help.
#include<stdio.h>
#include<math.h>
int main()
{
int x=25,y=40000;
//printf("Enter x,y");
//scanf(%d %d,&x,&y)
long double dist;
dist=sqrt((47-x)*(47-x)+(132000-y)*(132000-y));
printf(" x= %d y=%d dist=%Lf\n",x,y,dist);
return 0;
}