I've created a program which gathers the starting point and endpoint of a polymer, this works fine and it retrieves and outputs the points correctly, however, the problem I am having is the distance output, I want the program to use the start point and end point on each line and calculate its distance using the distance formula, which works but only for the first set of points then it copies and pastes the same distance onto the other set of points which is not how it is supposed to be. Any help would be greatly appreciated, Thank you.
srand() should be called only once per execution. If the loop from line 20 takes less than a second to complete one iteration, on line 23 you're going to seed rand() with the same value every iteration, so the output from rand() is going to be the same on all simulations.
Just move srand() outside all the loops.
By the way, this is unrelated to your question, but I've noticed a bug. The variable sim can take all integer values in the range [0;3999], but on several lines (e.g. line 33) you try to access angle[sim-1], arrx[sim-1] and arry[sim-1]. When sim == 0, these accesses are invalid.
Also, I think on line 37 I think you meant angle[sim]=angle[sim]+360;
Another problem is that that check assumes that angle[sim] is in degrees, even though you made the conversion to radians on line 32.