Skip to main content
2 of 2
Copy edited.
Peter Mortensen
  • 31.6k
  • 4
  • 22
  • 14

I am a fan of just putting it in a code block as the quote seems distracting for program output. I like the form of

//Sample code block
#include <iostream>

int main()
{
    std::cout << "Hello World!";
}

Output:

Hello World!

This way the text looks like it would in the console, but I am not surrounding it with any extra markup. To me this is pretty clear what the code is and what the output of that code block is.

NathanOliver
  • 179.4k
  • 8
  • 109
  • 145