Replace \n with \r\n

Hi Dudes,
I want to replace \n with \r\n through out the file. For this I opened vi editor there tried with " s/\\n/\\r\\n/g ", with this I must be able to satisfy my requirements. But it is searching for the current line (Where cursor is). I need this for entire file. No problem if it is with sed or awk. I dont have much idea on them.

Thanks in advance,

Regards,
Chanakya

ux2dos (some systems: unix2dos) will convert those the file the way you want.

ux2dos oldfile > newfile

man ux2dos

I need to change \n to \r\n in all the satements of file ..

Ex : printf("\nLINUX\n"); to be converted to printf("\r\nLINUX\r\n");

I got the solution. can be done with the statement

%s/\\n/\\r\\n/g

Thanks