I was working on a theme recently and have to show category names (comma separated). So, i found this useful piece of code. You can change the comma inside quotes (‘, ‘) in last line to anything you like for separator.
$categories = get_the_category();
$category_names = array();
foreach ($categories as $category)
{
$category_names[] = $category->cat_name;
}
echo implode(', ', $category_names);