Question: what is the difference between printf and fprintf?
Answer: printf() and fprintf() both are used for formatted output(write). The only difference is that printf() write directly into standard console (monitor) where as fprintf() take file stream as a parameter where to write.