Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Specifer



Working with switch case



Comment



Header file



Iterative statement




Distance between two point



// AHF C PROGRAM SOLVING

//solving here basic type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int x1,x2,y1,y2; float res=0; pf("\nEnter the value of first point ( x1 and y1 ) : "); scanf("%d %d",&x1,&y1); pf("\nEnter the value of second point ( x2 and y2 ) : "); scanf("%d %d",&x2,&y2); res=sqrt(pow((x2-x1),2) + pow((y2-y1),2)); pf("\nThe distance between two point is = %f",res); return 0; }
OUTPUT:


© 2018 - All rights reserved