{"id":4674,"date":"2021-11-11T23:00:00","date_gmt":"2021-11-11T17:30:00","guid":{"rendered":"https:\/\/www.codingbroz.com\/?p=4674"},"modified":"2021-11-11T20:52:53","modified_gmt":"2021-11-11T15:22:53","slug":"c-program-to-calculate-distance-between-two-points","status":"publish","type":"post","link":"https:\/\/www.codingbroz.com\/c-program-to-calculate-distance-between-two-points\/","title":{"rendered":"C Program to Calculate Distance Between Two Points"},"content":{"rendered":"\n

In this post, we will learn how to calculate the distance between two points using the C<\/strong> Programming language.<\/p>\n\n\n\n

Distance between two points is the length of the line segment that connects the two given points. The formula for the distance d, between two points whose coordinates are (x1, y1)<\/strong> and (x2, y2)<\/strong> is:<\/p>\n\n\n\n

D = [(x2 – x1) – (y2 – y1)]<\/strong>\u00bd<\/strong>\u00a0<\/sup><\/p>\n\n\n\n

We will be using the above formula in our program to calculate the distance between two points.<\/p>\n\n\n\n

So, without further ado, let\u2019s begin this tutorial.<\/p>\n\n\n\n

\n