Here is a C file that prints a greeting (fetched dynamically):

Some text in between the examples, explaining what the next file does.

Now here is a C file that prints a farewell (also fetched dynamically):

Now here is a shell session shown using a raw <pre> block:

$ gcc hello.c -o hello
$ ./hello
Hello, world!
$ gcc goodbye.c -o goodbye
$  ./goodbye
Goodbye, world!
$ 

And here is a pre-formatted block of perl code:

#!/usr/bin/perl

use strict;
use warnings;
use feature 'say';

sub greet {
    my ($name) = @_;
    return "Hello, $name!";
}

my @names = qw(Alexis Karin Kevin);

for my $n (@names) {
    say greet($n);
}

And here is a fenced code block using Markdown syntax:

def greet(name):
    return f"Hello, {name}!"

print(greet("Alexis"))