#include <windows.h>
#include <iostream>
#include <string>

using namespace std;

int
main(int argc, char* argv[])
{
   DWORD dwVersion = 0; 
   DWORD dwMajorVersion = 0;
   DWORD dwMinorVersion = 0; 
   DWORD dwBuild = 0;

   dwVersion = GetVersion();

   dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
   dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));

   if(dwVersion < 0x80000000)              
      dwBuild = (DWORD)(HIWORD(dwVersion));

   cout << "Windows Version " << (int)dwMajorVersion << "."
        << (int)dwMinorVersion << " (" << (int)dwBuild << ")" << endl;

   return 0;
}
