[Info-vax] ChatGPT - Joke about OpenVMS and Linux walking into a bar

Slo slovuj at gmail.com
Sat Dec 31 16:21:00 EST 2022


This is much better, beats reading the docs and googling for someone new to OpenVMS:

1. Code VAX C program to add the first 20 integers
--------------------------------------------------------------------------------
Here is a VAX C program that adds the first 20 integers:
#include <stdio.h>
int main() {
int i;
int sum = 0;
// Loop through the first 20 integers and add them to the sum
for (i = 1; i <= 20; i++) {
sum += i;
}
// Print the result
printf("The sum of the first 20 integers is: %d\n", sum);
return 0;
}

2. compile link and run
------------------------------------

To compile, link, and run a VAX C program on OpenVMS, you can follow these steps:

    Compile the program using the CC command. For example:
    $ CC MYPROG.C

    Link the program using the LINK command. For example:
    $ LINK MYPROG, SYS$SHARE:VAXCRTL/OPT

    Run the program by typing the name of the executable file. For example:
    $ MYPROG

Note: These steps assume that you have the necessary tools and libraries installed on 
your OpenVMS system. You may also need to specify additional options or libraries 
depending on your program's needs.



More information about the Info-vax mailing list