#include #include #include int main(int argc, const char *argv[]) { // We use two threads for this exercise omp_set_num_threads(2); // The variable is declared outside the parallel section int i; // The variable needs to be private to get the full output #pragma omp parallel private(i) { i = 5; while(i <= 10) { printf("Iteration %d in thread: %d\n", i, omp_get_thread_num()); i++; } } return 0; }