In C, files are just streams. But unlike standard streams you need to open and close them on the fly.
In C, the “scanf()” function is used to read data from a keyboard and the “printf()” function writes data to a monitor. Actually, scanf and printf do not know nothing about a keyboard or a monitor. And then how do they work?