int can only store whole numbers. You probably want to store the result as a double instead.
Last edited on
but even when I input 100 in x1, y1, x2, and y2 I don't get 0 as my answer.
What is the type of x1, x2, etc. ?
Ok, I figured it out. No problem with the calculation rather another part of my program messing with the "dist" variable.