CAn anyone help me out

i am trying to work out the line of best fit within visual studios c++ how do i go about writing a program to do this