How to allow users to login with a particular role they have selected? I have a multiple roles in my site, let's say I have role A, B, C, D.

I want users to be able to choose which role a user wants when logging in. And then the user should only be able to access the content for the selected role (even if the user has multiple roles).

Any suggestions about how to implement this?
Changing roles would probably require the permission "Administer permissions" so it could be hard. There's a module that does what you want, but it would probably require some modification: https://drupal.org/project/roleswitcher

There's also the Masquerade module (https://drupal.org/project/masquerade) which offers the ability to switch user account - which may be useful depending on your needs.