This code does what you are asking for:
#include <stdio.h>
#include<minix/config.h>
int main(int argc, char**argv) {
printf("the os version is %s.%s\n",OS_RELEASE,OS_VERSION);
return 0;
}
If this is a university project I doubt this is what is being asked of you. Sure you aren't being asked to implement a new system call that gives the os version, and then write a small program that calls it?
******** Edit after many years due to a recent comment ***
If you want to grab this from the running current instead of statically, you want to look at the uname(2) manpage. uname will fill a struct for you with all OS release, version, arch, and so forth.
Don't have a running minix machine to put together/verify a quick program to call and print this info. Should be straight forward. Might replace this paragraph with sample program.