C/C++

Code

Hello world

helloworld.c

#include <stdio.h>  // contains functions for input and output

int main()
{
    printf("Hello, world!\n");
    return 0;
}

helloworld.cpp / helloworld.cc

#include <iostream>   // c++ classes don't use .h extensions
using namespace std;

int main()
{
    cout << "Hello, world!" << endl;
    return 0;
}

More

Some C programs I've written are available on the code page.