KNN classifier in C