You could use get_the_category()
to do that.
Example:
<?php
$category = get_the_category();
// use this to echo the slug
echo $category[0]->slug;
// use this to echo the cat id
echo $category[0]->cat_ID;
// if you've got multiple categories you can run a foreach loop like so
foreach ( $category as $cat ) :
echo '<li>' . $cat->name . '</li>';
endforeach;
?>
You could use print_r($category)
:
<?php
echo '<pre>';
print_r($category);
echo '</pre>';
?>
to view the array of objects that are returned.