On an array the outer loop is the nrows- hold this constant while loop through the ncols.

Also, I would not name the file I am reading from- have a ".c" extension"- usually it is a .dat or .txt.