File Handling - Writing formatted data into text file using fprintf function