Well if you've mastered printf(), then you should be able to do the same with fprintf()