Using OMP SINGLE in an OpenMP program

This exercise presents a simple program to demonstrate the use of OMP SINGLE. Compile and run the code provided below. Run several times. What happens if you remove the #pragma omp single line?

 

#include 
#include 

main(){
#pragma omp parallel
 {
#pragma omp single
    {
      printf("%d YOU SHOULD ONLY SEE THIS ONCE
", omp_get_thread_num());
    }
 }
}