#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
If short invocation commands have been set up, enter the following command:
xlc hello.c -o helloIf short invocation commands have not been set up, enter the following command:
installation_path/vacpp/11.1/bin/xlc hello.c -o hellowhere installation_path is the installation location of the compiler packages. If the compiler has been installed to the default location, installation_path is /opt/ibmcmp/.
./hello
The result should be "Hello World!".
echo $?
The result should be 0.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
return 0;
}
If short invocation commands have been set up, enter the following command:
xlc++ hello.cpp -o helloIf short invocation commands have not been set up, enter the following command:
installation_path/vacpp/11.1/bin/xlc++ hello.cpp -o hellowhere installation_path is the installation location of the compiler packages. If the compiler has been installed to the default location, installation_path is /opt/ibmcmp/.
./hello
The result should be "Hello World!".
echo $?
The result should be “0”.