Cheap, dirty code for Windows and *nix.

#include <stdio.h>
#include <stdlib.h>

#ifdef WIN32
  #define USER "USERNAME"
  #define HOST "COMPUTERNAME"
#elif defined __unix__
  #define USER "USER"
  #define HOST "HOST"
#else
  #error Sorry don't know the environment variable(of the target platform).
#endif

int main()
{
    printf("%s says, \"Hello %s.\"\n", getenv(HOST), getenv(USER));

    getchar();
    return(0);
}
The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.