(Solved): Write \( \mathrm{C}++ \) program to calculate distance between two points \( (x 1, y 1) \) and \( ( ...
Write \( \mathrm{C}++ \) program to calculate distance between two points \( (x 1, y 1) \) and \( (x 2, y 2) \), you should use function name dist, which return double value and the parameters are integers, also you should use cmath library to calculate square root (use predefined functions: sqrt and pow). the equation of distance: \[ \sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}} \] Sample: x1 x2 y1 y2 \( >25813 \) Distance \( =10 \) \( > \) Press enter or any key to exit the consoles
// Explanation is given line by line // Image of code is given // Image of output is given // NOTE -> You have given different sample input and output is different i.e 10 // -> 2 5 8 13 -> Answer = 5.830952 // -> 2 8 5 13 -> Answer = 10 // -