How to add code (java, c, c++) code into my page

How to add code (java, c, c++) code into my page

I want to add the programs of different languages (C, C++, Java) into my website.
How do I achieve this?

For your reference., I want to add programs like to below to my website.

  1. #include <stdio.h>
  2. int main() {
  3.   int a;
  4.   long b;   // equivalent to long int b;

  5.   printf("Size of int = %zu bytes \n", sizeof(a));
  6.   printf("Size of long int = %zu bytes\n", sizeof(b));
  7.   return 0;
  8. }