/*Newly added tags for bing*/ Unipune Codes: Accept x and y coordinates of two points and find the distance between two points

Pages

Saturday, 1 May 2021

Accept x and y coordinates of two points and find the distance between two points

  


       
/*
Accept x and y coordinates of two points and find the distance
between two points.
*/

#include<stdio.h>
main()

{
    int x1,y1,x2,y2;
    float d;

    printf("Enter x1,y1,x2,y2- ");
scanf("%d%d%d%d",&x1,&y1,&x2,&y2); d=sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));
printf(" Distance=%f",d); }


No comments:

Post a Comment