Show One Level Category id

The function get_ancestors() will give you an array containing all of the parents of your category with the nearest ancestor being first in the array. So:

$cid = 5; // your category ID
$c = get_ancestors($cid,'category');
var_dump($c); // debugging
$p = array_shift($c);
// var_dump($p); // debugging

Use $p to do whatever you need to do.