One thing that should be mentioned other than @
David's good advice is never, never, never use magic numbers such as the 13 that you use in your program (twice, and each instance represents something different). If you revisit the program six months from now you may not have a clue what the 13's mean. Worse, if the project gets turned over to another coder/maintainer they'll have even less of a clue what the 13 means. Yes you can read the code and figure out it reads the first 13 chars of the first 13 lines of the input array, but you shouldn't have to spend the time on that. And you could be tired/distracted/whatever and not get it right when you redecipher those card-coded numbers.
Most every language has functions to tell you what the size of an array/structure/whatever is. Use those instead.