Why my C code is not working ?
#include<stdio.h> #include<math.h> void main() { int X1,X2,Y1,Y2,a,b,c,d; printf("Follow Yogesh Jangid\n"); while(1){ printf("Enter Frist point x coordinate\n"); scanf("%d\n",&X1); printf("Enter Frist point y coordinate\n"); scanf("%d\n",&X2); printf("Your Frist point is (%d,%d)\n",X1,X2); printf("Enter Second point x coordinate\n"); scanf("%d\n",&Y1); printf("Enter Frist point y coordinate\n"); scanf("%d\n",&Y2); printf("Your second point is (%d,%d)\n",Y1,Y2); a=pow((X2-X1),2); b=pow((Y2-Y1),2); d=a+b; c=pow(d,0.5); printf("The distance between points is %d\n\n\n",c); } } This is my code to find distance between points But it is not working properly and not giving right answer. Tell me why it's not working properly.