What is the difference between “w” and “a” modes?

“w” and “a” are fie modes which determines the type of operation to be done on data file. Both are used for writing data in a file.
The difference between them is-

– In “a” mode existing data of file is retained and new data is inserted at the end.
– In “w” mode existing data of file is truncated and new data is overwritten.

error: Content is protected !!