Program to read and write to a file

It is just a basic file operations , so that we can get to a better
understanding of file write and read.