Question 1: Splitting the data - Prepare a thread function to initialize int array x so that each element receives its index in the array: x[i]=i, and each thread initializes its portion of the array.
Note that i relates to the entire array.
The size of the array is N, and your program will execute with nthreads (which is a global value). Consider N is a multiple of nthreads.