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.