/*program to find the quadrant in which a point lies and to find the distance between two given points */ #include #include int main() { double a,b,x,y,distance; //declaring the variables printf("Enter the x cordinate and the y cordinate of the point: "); scanf("%lf %lf",&a,&b); if(a>0) //finding the quadrant in which a,b lies depending on the sign of a and b { if(b>0) printf("The point lies in the first quadrant\n"); else printf("The point lies in the fourth quadrant\n"); } else { if(b>0) printf("The point lies in the second quadrant\n"); else printf("The point lies in the third quadrant\n"); } printf("Enter the x cordinate and the y cordinate of the second point: "); scanf("%lf %lf",&x,&y); distance = sqrt(pow((x-a),2)+pow((y-b),2)); //applying the formula for distance between two points! printf("The distance between the points is %f\n",distance); }