If you have x males and y females then array will contain
male => x
female => y
To check, use this code
echo '<pre>'; print_r($array); echo '</pre>';
So,
echo "<br>Male percent : " . $array['male'] 100 / $total;
echo "<br>Female percent : " . $array['female'] 100 / $total;
If gender is held as 'M' or 'F' then use these in the above code instead of 'male', 'female'.
hth