function with structure

Hello,
I have the code below, and what I am trying to do is to make a function which will calculate the fitness of each old_chrome[i], form the old_chrome[i].genes[j] parameters. Particular the two print functions in the code should have the same result. The first prints the result by calculating them in the loop and the second prints the result from the function that calls. Clearly from the output that I have below this doesn't work. Any solution?

The first lines are the reading of input. Please check the numbers after the the fitness of chromosome and its not true shall be the same.