Download c source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <omp.h>
#include <stdio.h>

int main(void)
{
	#pragma omp parallel
	{
		#pragma omp critical (print)
		printf("Hello from thread %d of %d\n"
			, omp_get_thread_num()
			, omp_get_num_threads() );
	}
	return 0;
}