How to get categories for a product in Magento

How to get categories for a product in Magento, use the below snippet code anywhere in the magneto.

Editorial Staff
 

Editorial Staff at tutsplanet is a dedicated team to write various tutorial articles.