Update sorting.cpp

comment out output and move variable declaration outside the for loop