I'd imagen it would look something similar to this:

<?php if (is_subcategory()): ?>
<h1><?php the_category(); ?></h1>
<?php else: ?>
<h1>something else</h1>
<?php endif ?>

Can someone let me know how this will really be written?

Do this:

<?php if ( is_category() ) {
$child_cats = get_categories('child_of='.get_query_var('cat'));
}?>

http://codex.wordpress.org/Function_Reference/get_categories