Skip to main content
added 1 character in body
Source Link
Martin Sleziak
  • 4.7k
  • 2
  • 60
  • 122

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces indentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted


Since you explicitly mentioned <code>, the FAQ post says about this possibility: "Embed within <code> tags, and manually encode HTML entities: `` <html> `"

So if you prefer this for some reason this solution, it is also possible, although with some additional work. (In the above excerpt I had to use &num; for #, &lt; for < and &gt; for >.)

#include <stdio.h> int main() { int i; for (i=1; i<=3; i++) { printf("%d\n", i); } return 0; }

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces indentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted


Since you explicitly mentioned <code>, the FAQ post says about this possibility: "Embed within <code> tags, and manually encode HTML entities: `` <html> `"

So if you prefer this for some reason this solution, it is also possible, although with some additional work. (In the above excerpt I had to use &num; for #, &lt; for < and &gt; for >.

#include <stdio.h> int main() { int i; for (i=1; i<=3; i++) { printf("%d\n", i); } return 0; }

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces indentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted


Since you explicitly mentioned <code>, the FAQ post says about this possibility: "Embed within <code> tags, and manually encode HTML entities: `` <html> `"

So if you prefer this for some reason this solution, it is also possible, although with some additional work. (In the above excerpt I had to use &num; for #, &lt; for < and &gt; for >.)

#include <stdio.h> int main() { int i; for (i=1; i<=3; i++) { printf("%d\n", i); } return 0; }
added 549 characters in body
Source Link
Martin Sleziak
  • 4.7k
  • 2
  • 60
  • 122

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces indentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted


Since you explicitly mentioned <code>, the FAQ post says about this possibility: "Embed within <code> tags, and manually encode HTML entities: `` <html> `"

So if you prefer this for some reason this solution, it is also possible, although with some additional work. (In the above excerpt I had to use &num; for #, &lt; for < and &gt; for >.

#include <stdio.h> int main() { int i; for (i=1; i<=3; i++) { printf("%d\n", i); } return 0; }

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces indentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces indentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted


Since you explicitly mentioned <code>, the FAQ post says about this possibility: "Embed within <code> tags, and manually encode HTML entities: `` <html> `"

So if you prefer this for some reason this solution, it is also possible, although with some additional work. (In the above excerpt I had to use &num; for #, &lt; for < and &gt; for >.

#include <stdio.h> int main() { int i; for (i=1; i<=3; i++) { printf("%d\n", i); } return 0; }
minor typo
Source Link
Martin Sleziak
  • 4.7k
  • 2
  • 60
  • 122

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces intendationindentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces intendation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted

As explained in the editing help, in MarkDown you can achieve preformatted text by using four spaces indentation.

To achieve this after typing (or copy pasting) the code, simply select the relevant part and the click on the code button in the editor (between blockquote and insert image) or press Ctrl+K.

To test this I have taken an example of for cycle in C from this website. (Basically a random site that I got after searching for "for cycle c example".)

#include <stdio.h>
int main()
{
   int i;
   for (i=1; i<=3; i++)
   {
       printf("%d\n", i);
   }
   return 0;
}

You can find much more detailed information in the FAQ post: How do I format my code blocks? Here is a screenshot which I copied from that post:

Code blocking icon properly highlighted

added 141 characters in body
Source Link
Martin Sleziak
  • 4.7k
  • 2
  • 60
  • 122
Loading
Source Link
Martin Sleziak
  • 4.7k
  • 2
  • 60
  • 122
Loading