Never mind I found another method to solve my problem. but what I want to mention is printing double is still a problem (if I print the contents of two files into one file). I don’t know why ansys c compiler does that even though I don’t run in parallel. 

what i am trying above has nothing to do with any physics of the problem i was just trying to use the c program to help in automating some mundane tasks.