Magento: Get Category URL by ID

To get category’s URL by its ID use the following code

$category_id = 5;
echo Mage::getModel("catalog/category")->load($category_id)->getUrl();