After much research I would be explaining to you how tO logout from Whatsapp Account. Whatsapp doesn't have logout button or options on both mobile or web version even this has also been explained on whatsapp official website. It means whatsapp don’t want to give you access to logout from it app which I think suppose to be there to be able to switch between more than one whatsapp account.
Since Whatsapp didn't add the option, did you think this can be done in any other way? Probably YES
But why did you want to Logout of Whatsapp?
Some people do receives lots of chat messages which may be disturbing sometimes and this may bring about thinking of logging out. Some people might wanted to just switch account and logging out is needed. For those receiving too much messages the best thing is either switch off mobile data, diable conversation tones or you stop notifications.
HOW TO STOP WHATSAPP NOTIFICATIONS
Only for smartphones.
1. Go to your device Settings
2. Scroll down and tap on Apps
3. Here you would see all apps which you have downloaded on your mobile. You have to Find Whatsapp there and tap on it.
4. Uncheck the box next to “Show notifications.” and then click on Force Stop.
Now the alerts won't disturb anymore messages would be received silently, you would only see them when you open WhatsApp app.
HOW TO DISABLE/ENABLE CONVERSATION TONES ON WHATSAPP
Conversation tones are the sounds to be performed when you send and receive a text, audio or video message on whatsapp. The latest edition of WhatsApp for Android operating system has conversation tones turned on by the standard.
1. Open WhatsApp App.
2. Click on Menu Button > Settings > Notifications > Conversation tones.
3. Uncheck the box to convert the shades off. Check the box to convert the shades on.
NOTE: Editing the Conversation tones setting will change both the incoming and outgoing message tones simultaneously.
HOW TO LOGOUT FROM WHATSAPP
Are you intending to switch to another whatsapp account? It's now easy as you don't need to delete your whatsapp app anymore before this can be done.
1. Go to device settings » Apps and tap on Whatsapp.
2. Now tap on Clear Data and then clear cache as shown above.
Open your Whatsapp back and you would notice you have logged out.