How to show HTML and PHP code on a site?

Sometimes in tutorial blog or in some other cases it's needed to show html/php  code onto website.

Suppose you want to show  echo wp_ruby_1(); ?> then you can use the below codes

system1:  
<?php echo wp_ruby_1(); ?> 

or
system2:   '); ?>


System 1 can be used for both HTML/PHP but system 2 can be used for only php code