You are using the incorrect variable names and using variables before they've been read and initialized.
This line writefile << name << endl;
needs to follow cin >> name;
In your code, it proceeds it and that means name doesn't contain anything or maybe junk data.
I think these lines
cout<<"\n\nKey in recent deposit in Rs:";
cin >> accno;
Should be:
cout<<"\n\nKey in recent deposit in Rs:";
cin >> deposit;